On Sat, 2007-12-08 at 19:12 -0600, James Bennett wrote: [...] > In the first case, switching the positional order of the arguments > would suffice; having 'instance' move after the 'data' and 'files' > arguments would bring ModelForm back into line with "standard" > newforms forms. > > In the second case, the fix is probably a bit more code. Right now I'm > curious as to why, if it already knows from its Meta class what model > it's working with, ModelForm *always* needs an instance of the model; > it seems that it'd be better for 'instance' to default to None, and > have ModelForm be smart enough to create its own instance when none is > supplied. This would also preserve backwards compatibility with the > general historical trend of "forms that create model instances" -- > neither AddManipulator nor form_for_model have ever required users to > supply their own empty instance, and ModelForm's requirement of an > instance in all cases makes generic form-handling code somewhat > tortuous. > > Anyone have strong objections to either of these proposals?
I'm pretty much +1 on both, although I want to hear any thoughts from Joseph before making the change. Malcolm -- The hardness of butter is directly proportional to the softness of the bread. http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" 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-developers?hl=en -~----------~----~----~----~------~----~------~--~---
