Opened 16 years ago

Closed 11 years ago

#8565 closed Cleanup/optimization (wontfix)

Comments should use object_id instead of object_pk

Reported by: Peter Baumgartner Owned by: nobody
Component: contrib.comments Version: dev
Severity: Normal Keywords: comments generic object_pk object_id
Cc: pete@… Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django.contrib.comments.models.BaseCommentAbstractModel uses object_pk to create a generic relation

I may be missing something, but straying from the expected and documented default of object_id seems to only create extra confusion. I noticed this when trying to add a GenericTabularInline

Change History (6)

comment:1 by Ramiro Morales, 16 years ago

See also #8554

comment:2 by Jacob, 16 years ago

Resolution: duplicate
Status: newclosed

Dup of #8554.

comment:3 by anonymous, 12 years ago

Easy pickings: unset
Resolution: duplicate
Severity: Normal
Status: closedreopened
Type: Uncategorized
UI/UX: unset

I don't see how this is a duplicate of 8554, which has to do with casting the output of object_pk to text. The issue here is the use of "object_pk" instead of "object_id" has the field name. This non-standard field name requires anyone who extends it and uses GenericRelation back to use object_id_field="object_pk". This isn't documented anywhere either.

comment:4 by anonymous, 12 years ago

Type: UncategorizedBug

comment:5 by Łukasz Rekucki, 12 years ago

Triage Stage: UnreviewedSomeday/Maybe
Type: BugCleanup/optimization

This isn't documented anywhere either.

How about https://docs.djangoproject.com/en/1.4/ref/contrib/comments/models/ ?

I don't really see an issue here. Sure, it would be better if the original author used the default name, but having a different name doesn't break anything. Changing this would mean, *every* project using contrib.comments would have to migrate or monkey patch, so I don't think this is worth the trouble. Maybe in 2.0 ?

comment:6 by Aymeric Augustin, 11 years ago

Resolution: wontfix
Status: reopenedclosed

This is a bit annoying, but changing the name doesn't seem worth it at this point.

Note: See TracTickets for help on using tickets.
Back to Top