Hi



> There's no searching going on here. You create a lock instance,
> passing two positional arguments, which Django interprets as the first
> fields, ID and name.
>
> That's why you should never use positional arguments when instantiating -
> always do it via keyword arguments:
> lock = Lock(name=name, info=info)
>
> Thanks a lot Daniel.. i feel dumb now..


> Note that as I say, you're not actually checking if there's a lock with
> that name already. You probably want to actually do that.
>

Hmm.. i was just happy to leave it to the db to raise an error.  since i
use the unique key, that should work..
I agree should put in a check for the type of exception and display the
right message though...

>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to