If I have a field, for example a CharField named 'name', which must be
unique, what's the best way to ensure uniqueness whether creating a
new entry or editing an existing one?

By default, the form won't know if it is being used to edit or create,
so if you look for duplicates in the db, how would you know whether
any dup you found is just the current entry being edited?

Or is the form the wrong place for this kind of thing? Should this
instead be enforced in the model, and we should instead catch the
exception throw during the save attempt? I'm guessing not, as I was
once told that validation in the model is deprecated.

Thanks,
Mike
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to