Re: Access object in session from clean method in Form extending ModelForm

2008-11-26 Thread vanosten
Hi Daniel Thank you for the tip. Now it works :-) class CategoryItemForm(ModelForm): class Meta: model = CategoryItem exclude = ('position','defaultItem') #These two attributes shall only be changed in list view def clean(self): """ Checks whether the ti

Re: Access object in session from clean method in Form extending ModelForm

2008-11-26 Thread Daniel Roseman
On Nov 26, 8:07 am, vanosten <[EMAIL PROTECTED]> wrote: > Hi > > I need to do custom validation to make sure that a new record does not > pick the same title as a previous record. Therefore in my overriden > clean method in my custom Form (which extends ModelForm) I need to be > able to do either

Access object in session from clean method in Form extending ModelForm

2008-11-26 Thread vanosten
Hi I need to do custom validation to make sure that a new record does not pick the same title as a previous record. Therefore in my overriden clean method in my custom Form (which extends ModelForm) I need to be able to do either of the following: # access the session, where the parent object is