> The names used by the generic views are (as far as I am aware) > internally consistent within the views, and with the old generic > views. The choice to use pk instead of object_id was quite deliberate, > because every object responds to pk, but not necessarily to id. >
I don't believe it's backward compatible with the current generic views - http://docs.djangoproject.com/en/1.2/ref/generic-views/#django-views-generic-list-detail-object-detail. IMHO, it's the other way around: every viewable object got to have some kind of an id, but not necessarily a pk. In the case an object comes from the db the object_id is the primary key, in case I choose to override the get_object method I can use the object_id to retrieve an object from a dataset that has no primary keys. > Compatibility with third party libraries isn't really a consideration > unless the general community has converged on a convention which a new > Django feature has blindly ignored. In this case, I would argue that > pk is the convention, and Django-backlinks is in need of an update. hmm, I was under the impression `object_id` is the convention for urls and views while pk is used for models. Maybe, I'm wrong, but searching the docs, I found it was referenced by admin, contenttypes, comments and of course generic views. Benny -- 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.