On Dec 7, 2007 2:31 PM, Empty <[EMAIL PROTECTED]> wrote: > > > Seems dumpdata is coded to require a Manager named 'objects' for the > Models > > it dumps, even though (as described here: > > http://www.djangoproject.com/documentation/model-api/#manager-names), > Django > > does not require that a Manager named objects exists for all Models. > > Whether this is just an oversight in dumpdata or a conscious decision I > > can't say, though it looks like an oversight to me. > > You're correct Karen. This bit of code is the culprit: > > objects = [] > for app in app_list: > for model in get_models(app): > objects.extend(model.objects.all()) > > How would you propose that it be done differently? I know that > through object._meta.admin.manager will give you the first manager > like the Admin works off of, but that is only populated if the Admin > inner class is defined. I looked for the logic that does that but I > couldn't find it. >
I believe it should be using _default_manager, which looks to be set to track the first Manager defined for a Model. I think a (legitimate) Model will always have _default_manager, while it may not always have objects. Karen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---