Re: newforms validation

2007-01-22 Thread serbaut
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

Re: newforms validation

2007-01-17 Thread serbaut
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,

Re: newforms validation

2007-01-17 Thread serbaut
) 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

Re: newforms validation

2007-01-17 Thread serbaut
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

Re: newforms validation

2007-01-17 Thread serbaut
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,

Re: filter records without parent

2006-11-08 Thread serbaut
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

Re: Order_by problem

2006-11-08 Thread serbaut
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

Re: non-cascading delete?

2006-09-12 Thread serbaut
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