#12569: GenericInlineModelAdmin's get_formset method has a non standard 
signature
------------------------------------------------+---------------------------
 Reporter:  specialunderwear                    |       Owner:  nobody    
   Status:  new                                 |   Milestone:  1.2       
Component:  Uncategorized                       |     Version:  1.2-alpha 
 Keywords:  inline get_formset defaults kwargs  |       Stage:  Unreviewed
Has_patch:  1                                   |  
------------------------------------------------+---------------------------
 Unlike InlineModelAdmin GenericInlineModelAdmin does not let you override
 any values using keyword arguments.

 InlineModelAdmin's signature looks like this:


 {{{
 def get_formset(self, request, obj=None, **kwargs):
 }}}

 Any keyword arguments passed will override settings in the defaults dict
 which is constructed inside the function.
 This mechanic makes overriding the method while still using some of the
 standard functionality inside get_formset very streamlined.

 If the same is tried with GenericInlineModelAdmin you will have to copy
 paste the whole function body because this the signature of it's
 get_formset method:


 {{{
 def get_formset(self, request, obj=None):
 }}}

 The defaults object constructed inside the method can not be overriden by
 passing keyword arguments, meaning you can not reuse any of the
 functionality in the method when overriding it, using inheritance.

 Solution:

 Make GenericInlineModelAdmin use the same mechanic as InlineModelAdmin so
 you can override the defaults object using keyword arguments.

 See against current trunk.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12569>
Django <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 django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to