On 3/21/07, ZebZiggle <[EMAIL PROTECTED]> wrote: > I'm going to have to deal with this, so here's what I'm thinking: some > sort of helper function that will do a filter() but act as a .get() in > that it only returns 1, but in the event more than 1 comes back notify > the admin that the integrity of the database has been compromised. > Alternatively, I may need to research if there is a way to put a > constraint on the database that prevents duplication in the tables and > raises an exception at "insert" time.
You could try doing "get_or_create", which looks to see if there's already an object matching the criteria you've handed it, and will not create a new object if one already exists. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---