Ok, just gave this a shot and got no errors, but the changes I made in the child didn't take affect. The code for the parent form and its child is at: http://dpaste.com/35195/
It seems like the parent's fields are being defined, then the spectral_required variable. So as far as the child is concerned, the fields aren't required. Submitting the form with the child's required fields shows no errors. Does this involve over-riding the __init__ method or something? Perhaps I'm thinking of this in the wrong way. On Feb 14, 2:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I haven't checked out django trunk in a few days, it wasn't working > earlier (With a NoneType error). I'll get the latest Django and try it > again with a follow-up. > > On Feb 14, 1:41 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > > > On Thu, 2008-02-14 at 10:17 -0800, [EMAIL PROTECTED] wrote: > > > Is there a good way to sub-class a form that subclasses ModelForm? For > > > example, I have two forms that use the same field but one requires > > > certain fields to be required and the other doesn't. > > > > Am I right to sub-class the first form or is there a better way to do > > > this? > > > Subclassing would seem to be the right answer here. Then you just add > > the extra validation (clean_FOO) functions to the child class. What's > > your concern with this approach (beyond the fact that it may not have > > entirely worked up until a couple of hours ago)? > > > Malcolm > > > -- > > On the other hand, you have different > > fingers.http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---