Re: Another question about form validation?

2008-06-23 Thread Adi
Thanks everyone. On Jun 23, 1:43 pm, phillc <[EMAIL PROTECTED]> wrote: > class FormFoo(ModelForm): >   def __init__(self, obj1, *args, **kwargs): >     super(FormFoo, self).__init__(*args, **kwargs) >     self.object1 = obj1 >   def clean(self): >     # use self.object1 here > > On Jun 23, 12:23 

Re: Another question about form validation?

2008-06-23 Thread phillc
class FormFoo(ModelForm): def __init__(self, obj1, *args, **kwargs): super(FormFoo, self).__init__(*args, **kwargs) self.object1 = obj1 def clean(self): # use self.object1 here On Jun 23, 12:23 pm, Adi <[EMAIL PROTECTED]> wrote: > do you mean something like this. > > class

Re: Another question about form validation?

2008-06-23 Thread Adi
do you mean something like this. class FormFoo(ModelForm): def __init__(self,*args,**kwargs): self.object1 = kwargs.pop('obj1') def clean(self): # use the self.object1 here On Jun 23, 10:48 am, Alex Koshelev <[EMAIL PROTECTED]>

Re: Another question about form validation?

2008-06-23 Thread Alex Koshelev
Pass it through form custom constructor On Jun 23, 7:12 pm, Adi <[EMAIL PROTECTED]> wrote: > How do you pass model objects that you may need access to when > implementing the clean() or clean_ methods? > > In other words, how can a form access model objects that it may need > access to perform

Another question about form validation?

2008-06-23 Thread Adi
How do you pass model objects that you may need access to when implementing the clean() or clean_ methods? In other words, how can a form access model objects that it may need access to perform its validation? --~--~-~--~~~---~--~~ You received this message