I had the same issue in the past. There's a bug in the django code and a ticket was already scheduled. Before 0.96, that by the way seems to improve a lot the admin class providing more hooks to customize It, you can add a row in your Admin class code that says:
manager=myCustomManager() Hope It helps. Picio 2007/3/5, Michael Cuddy <[EMAIL PROTECTED]>: > > I've defined a custom manager for some of my models (similar to, but not > exactly like filtering by settings.SITE_ID). > > Unfortunately, the Model's manager doesn't seem to get used in the > admin interface? > > from myapp.company.managers import CurrentCompanyManager > > class Person(models.Model): > objects = CurrentCompanyManager() > > name = ... > > (CurrentCompanyManager() ctor's a manager which filters based on a global > 'company id' which is derived from the HTTP_HOST in the URL). i.e.: > > http://foo.domain.com/admin/person/person/ > > should give a different listing than > > http://bar.domain.com/admin/person/person/ > > (for those curious, I'm using a middleware module to setup the global, > and a thread local to store it :-) > > I have tested that the manager works from the command line (manage.py shell), > but I'm not seeing the filtering done in the admin interface for the > object_list display. > > If I click on an object which should be filtered, I get a 404 error > (and via a 'print' in the manager class, I see the manager getting called), > but I don't see the manager getting invoked when I fetch the > object list page. > > -- > Mike Cuddy ([EMAIL PROTECTED]), Programmer, Baritone, Daddy, Human. > Fen's Ende Software, Redwood City, CA, USA, Earth, Sol System, Milky Way. > > "The problem with defending the purity of the English language is > that English is about as pure as a cribhouse whore. We don't just > borrow words; on occasion, English has pursued other languages down > alleyways to beat them unconscious and rifle their pockets for new > vocabulary." -- James D. Nicoll > > Join CAUCE: The Coalition Against Unsolicited Commercial E-mail. > <http://www.cauce.org/> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---