On Jul 3, 2006, at 7:11 PM, DavidA wrote:
>
> In this case it would be up to the app or developer to populate the
> slug primary key field before saving. But then just testing the pk
> field wouldn't really tell me if it was saved, unless I misunderstand
> what "self.pk" is actually doing behind the scenes.

As you say, the author of the code should know which tables have  
primary keys that are pre-populated and which are not, no magic  
there, so you should code accordingly.

Django handles this by checking to see if the object has a primary  
key in the database and honors any primary keys created by the user  
(assuming the user submits a unique key).

Don


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to