On Thu, Oct 2, 2008 at 6:23 PM, bruno desthuilliers < [EMAIL PROTECTED]> wrote:
> > On 2 oct, 16:51, Michael Newman <[EMAIL PROTECTED]> wrote: > > Kurczak; > > > > Short of this is, catching specific errors in the save method and > > displaying them to the user are hard and you might be regurgitating > > items back to the user that they really don't have any business seeing > > (SQL errors, programming errors, etc.). > > So far so good. > > > The best way to check for the > > proper values is to do it at the form level. > > (snip) > > > In this way you are avoiding the model validation on the save method > > Err... > > The best way is to do it at *both* levels (yes, not totally DRY, > but...). The model is responsible for data correctness and integrity. > You definitively don't want to "avoid model validation" and allow a > model object with incorrect data to be saved. > > My 2 cents. Sigh. Model level validation is going to get into Django at some point. However, doing this type of checking is not model level validation, and no matter where it is put, will not become model level validation. Here you are validating input, checking and cleaning it and reporting back to the user. The best way to do that is in the form's clean methods. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---

