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
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
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]>
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
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
5 matches
Mail list logo