hello, i have a clean method in my forms.py. I want this to check a
person is old enough to enter a competiton

The problem i have is that the minimum age changes and is a field in
the competition model(it is entered by the user).

My clean method is like this (pseudo code):

class personform(forms.Form):
         ...................

        def clean_recipients(self):
                dateOfBirth = self.cleaned_data['dob']
                if dateOfBirth > competition.min_age
                ......
                return data

The same form is used to enter any competition, and uses the url to
get the competition id

eg: mysite.com/enter_competition/my_competition

since competition_slug will only become apparent from the url in views
how can i find out the relevant min_age for my clean method in
forms.py?

I would be greatful for any help, sorry if i haven't explained this
very well.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to