Re: unique=True doesn't work

2012-05-11 Thread .
Thanks for you comments. I've recreated my repo and it worked. -- 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 django-users+unsubs

Re: unique=True doesn't work

2012-05-11 Thread Nikolas Stevenson-Molnar
Take a look at your database schema and make sure that table actually has a unique key for the `foo` column. _Nik On 5/11/2012 1:16 PM, . wrote: > Hi there, > > Here is my class: > > MyClass(User): > foo = IPAddressField(unique=True) > > unique doesn't work: > > python manage.py shell > > from

Re: unique=True doesn't work

2012-05-11 Thread Javier Guerra Giraldez
On Fri, May 11, 2012 at 3:16 PM, . wrote: > It should raise an exception, but there is no one. > (username's unique=True works.) my guess: the IPAddress field didn't have unique=True at first, but it was added afterwards. the syncdb command doesn't modify existing tables. if you want that, you c

unique=True doesn't work

2012-05-11 Thread .
Hi there, Here is my class: MyClass(User): foo = IPAddressField(unique=True) unique doesn't work: python manage.py shell from myproject.models import MyClass bar = MyClass(foo="12", username="first", password="secret") bar.save() baz = MyClass(foo="12", username="second", password="secret")