#3987: ModelAdmin should allow for overriding of ForeignKey/ManyToMany options
----------------------------------------------------+-----------------------
Reporter: Baptiste <[EMAIL PROTECTED]> | Owner: nobody
Status: new | Component:
Admin interface
Version: newforms-admin | Resolution:
Keywords: | Stage:
Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
----------------------------------------------------+-----------------------
Comment (by ext):
I attached an updated version of patch. It now works with revision: 6426.
A little change I did to the patch is removal of all occurences of:
{{{
defaults = {'form_class': forms.ModelChoiceField}
#To prevent an useless query
if not 'queryset' in kwargs:
defaults['queryset'] = self.rel.to._default_manager.all()
}}}
in favour of original code:
{{{
defaults = {'form_class': forms.ModelChoiceField, 'queryset':
self.rel.to._default_manager.all()}
}}}
The reason is that !QuerySets are lazy so there is no "useless query".
--
Ticket URL: <http://code.djangoproject.com/ticket/3987#comment:11>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---