-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/02/2011 07:29 PM, Kääriäinen Anssi wrote: > At this point this is not the idea. The idea is to just disallow this > (assuming > multicolumn PK firstname, lastname): > > user = User(firstname = 'Jack', lastname = 'Smith') > user.save() > user.firstname = 'John' > user.save() > > Current behavior will leave Jack Smith in the DB, and save John Smith as > new object. I my opinion it is too easy to clone the object accidentally.
Did we gain support for multi-column PK recently and I missed it? Or is this just a hypothetical example assuming such support is added in the future? > The idea would be to raise exception from the second save (deprecation > warning at this point). A way to get the current behavior is needed too, but > the user should explicitly request that. Hmm, I'm not so sure this is really a problem, or enough of a problem to warrant making people change currently-working code. If you use non-sequence PKs (and usually you shouldn't), you should be aware of what you're doing. If the real problem is the way the admin exposes the possibility of accidental cloning to end users, maybe we should be looking at a simpler admin-level fix (like not making PK fields editable by default)? Carl -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7ZkYIACgkQ8W4rlRKtE2fwGgCeOan3naNFeAddJHFCP0XGp7wh LLgAn2g9MUPrafpE+h9yz4kWtQOnZht2 =ID4P -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.