On 12/29/06, Vadim Macagon <[EMAIL PROTECTED]> wrote:
Adrian Holovaty wrote: > > Would it help if the form automatically called its validation the > first time you accessed form.clean_data? I'm trying to decide whether > that would be convenient or too magic. > I kind of like the way it is now, if form.clean_data did the validation on first access how would you tell if the validation was successful? You'd have to call form.is_valid() anyway, so it seems logical to me not to try to access form.clean_data before checking if validation succeeded. If it's not valid you probably have to redisplay the form anyway, so no point doing extra work processing clean_data that will get discarded.
My thought exactly. I couldn't have said it better myself. Although, I will admit that my confusion came from thinking that accessing form.clean_data would call the validation. However, that could be attributed to the current lack of documentation (a problem that will no doubt be addressed soon) than anything else. And once I got the logic worked out in my view, the current implementation certainly made more sense and was less magic. -- ---- Waylan Limberg [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ 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, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---