[storm] (no subject)
Jamu Kakar
jamshed.kakar at canonical.com
Tue Apr 22 18:03:49 BST 2008
Hi Tim,
Tim Moran wrote:
> I'm wanting to make sure that user_name and email_address are unique for
> each user. Would the easiest way of doing this be to subclass an existing
> Property class and overide __set__ to add in the validation that way, or
> is there a simpler way?
Storm doesn't currently provide any functionality to deal with
unique values in Python code. You'll want to have a UNIQUE
constraint in your site_user table to ensure that no bad data can
get into the database and then either catch the exception raised
when you add a duplicate User or explicitly check for duplicates
before adding User's to a store.
Thanks,
J.
More information about the storm
mailing list