Ah, yes, sort of obvious in retrospect. But at least I was in the neighborhood of a sane way of using it.
Thanks. On Aug 19, 5:49 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 8/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > forms.models.form_for_instance(original_laborder, form=LabOrderForm) > > > Is there a more django-esque to get a custom clean method for an auto- > > generated form like this or is this the way it's supposed to go? > > There's actually two ways to do this. Your way is one method. The > other is to use conventional model inheritance. Remember, > form_for_model returns a class, so the following will be legal: > > BaseLabOrderForm = forms.form_for_instance(original_laborder) > class LabOrderForm(BaseLabOrderForm): > def clean(self): > ... > > Both will work; it's entirely up to you which one you prefer. > > > Also it seems that newforms doesn't respect the validator_list in the > > model, is that correct? As designed? > > Yes. Form validation and model validation are decoupled. Model > validation is a work in progress. > > Yours, > Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---