The clean_XXX methods documented in the regression tests mentioned
above did it for me. I think the new api is much cleaner(!) than the
old.
The only thing is that I think the clean_XXX should be passed the
cleaned value so far since you most likely will be doing:
def clean_XXX(self):
value
Thank you both. Django rocks by the way!
--~--~-~--~~~---~--~~
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,
)
Joakim
On Jan 17, 7:00 pm, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote:
On 1/17/07, serbaut <[EMAIL PROTECTED]> wrote:
> > def my_view(request):
> > f = MyForm({'foo': request.POST['foo'], 'bar':
request.user.username})
> > The form library it
def my_view(request):
f = MyForm({'foo': request.POST['foo'], 'bar': request.user.username})
The form library itself knows nothing about request objects.
But my Field doesnt know about its' form so how does this help my
Field.clean(self, value) validator?
Joakim
Creating field classes for validation makes sense but what if I need to
validate in a request context?
Say for example that I need to check permissions for request.user in
clean?
def clean(self, value):
if request.user.has_some_property() and value > 100:
raise forms.ValidationError,
Try parent__isnull=True.
http://www.djangoproject.com/documentation/db_api/
--~--~-~--~~~---~--~~
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
I dont know what get_list is but this should get you all words in
order:
words = Word.objects.order_by('Word')
http://www.djangoproject.com/documentation/db_api/#order-by-fields
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
On the same issue:
What if you want the database to take care of the cascade? Lets say you
have 20,000 references that needs to be deleted, it would be much more
efficient with "ON DELETE CASCADE".
--~--~-~--~~~---~--~~
You received this message because you are
8 matches
Mail list logo