#15125: UpdateView should introspect form_class instead of requiring you to pass
the model
------------------------------------+---------------------------------------
          Reporter:  sontek         |         Owner:  nobody
            Status:  new            |     Milestone:  1.3   
         Component:  Generic views  |       Version:  SVN   
        Resolution:                 |      Keywords:        
             Stage:  Accepted       |     Has_patch:  1     
        Needs_docs:  0              |   Needs_tests:  0     
Needs_better_patch:  1              |  
------------------------------------+---------------------------------------
Changes (by russellm):

  * needs_better_patch:  => 1
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 Accepted on the basis that yes, model information will be available under
 some circumstances, and shouldn't require double-entry. However, I have
 two problems with the provided patch.

 Firstly, this presumes that form_class has a _meta.model, which it wont
 unless you have a ModelForm. Forms don't have to be model forms in order
 to save a model.

 Secondly, I'd rather see this handled by introducing a get_model() entry
 point, rather than using the constructor. The default implementation would
 just return self.model, but this would provide the flexibility for
 arbitrary control of the source model, including introspection of
 form_class when possible.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15125#comment:1>
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 [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.

Reply via email to