Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4340268
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:19:35+00:00 2026-05-21T11:19:35+00:00

First a little background: I have an Event model that has various event_type s.

  • 0

First a little background:

I have an Event model that has various event_types. I want to break one of those event types, ‘Film’, into it’s own admin. I have the basic functionality in place: a proxy model inheriting from Event, named Film, a custom manager for that proxy model that filters it to only ‘film’ event types, and it’s own ModelAdmin.

The problem is with the reverse. I now need to filter out films from the main Event admin. I don’t want to alter the Event model or its default manager, because the impact would be too widespread. So, I tried creating another proxy model, EventAdminProxy, with the sole purpose of providing a filtered list of events in the admin. I then register this model, instead of Event, with the existing ModelAdmin.

This obviously works, but it has the unfortunate side-effect of altering the URLs in the admin. Instead of the changelist being at “/admin/event/event/”, it’s now at “/admin/event/eventadminproxy/”.

What I’m trying to do is keep this setup, but also keep the old URL. I’ve tried overloading the ModelAdmin’s get_urls method, but from what I can tell, you can’t control the full URL there, only what comes after the “/app_label/model_class/” part.

I thought about overriding it in the main urls.py, but can’t figure out an acceptable view to tie into. The actual views are only available on the instantiated ModelAdmin object, not the class itself.

Any ideas of how override the URL being used in the admin?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:19:36+00:00Added an answer on May 21, 2026 at 11:19 am

    You could override the queryset-method of your EventModelAdmin and filter the queryset so that Film-Events get excluded.

    Something similar to this:

    class EventAdmin(admin.ModelAdmin):
    
        def queryset(self, request):
            qs = super(EventAdmin, self).queryset(request)
            return qs.exclude(event_type='film')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, a little background: I'm displaying a data set with 288 rows and 8
First a little background. I am building a mobile app for a client, this
First a little intro: Last year i wrote this http://dragan.yourtree.org/code/canvas-3d-graph/ Now, i want to
First question on here so please be nice :) I know very little about
I know this question might sound a little cheesy but this is the first
OK, having tried my first TDD attempt, it's time to reflect a little and
First off, I am using Windows XP. I have multiple hard drives and it
First of all, I know how to build a Java application. But I have
As I'm a newbie to jQuery I'm having a little problem. I have two
I have a variable ( $output ) that is set to a string. To

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.