Patch django-taggit to fix #282 #322

Merged
merged 2 commits into from Jul 8, 2015

Projects

None yet

3 participants

@russmo
Contributor
russmo commented Jun 24, 2015

django-taggit has a bug (#282) where it assumes that the tagged model
has a field named id which is the primary key. This isn't the case in
our database as we use a more descriptive pk/id field name. The django-taggit API lookup features fail unless this is fixed.

This commit patches the code using the fix in:
#283 and stevenday/django-taggit

@russmo russmo Patch django-taggit to fix #282
django-taggit has a bug (#282) where it assumes that the tagged model
has a field named id which is the primary key. This isn't the case in
our database, because it wasn't originally created by Django and so
didn't follow that convention.

This commit patches the code using the fix in:
stevenday/django-taggit
b6d9e9d
@frewsxcv frewsxcv and 1 other commented on an outdated diff Jun 25, 2015
taggit/managers.py
else:
- return (("object_id", "id"),)
+ return ((self.model._meta.pk.column, "id"),)
@frewsxcv
frewsxcv Jun 25, 2015 Collaborator

should this be return (("object_id", self.model._meta.pk.column),)?

@svleeuwen
svleeuwen Jul 8, 2015

yes, the else should be return (("object_id", self.model._meta.pk.column),)

@russmo
Contributor
russmo commented Jul 8, 2015

Sorry about that mixup in the order. My bad. I've fixed it and the pull request awaits your approval.

@frewsxcv frewsxcv merged commit 645ac41 into alex:develop Jul 8, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@frewsxcv
Collaborator
frewsxcv commented Jul 8, 2015

Thanks @russmo !

@frewsxcv
Collaborator
frewsxcv commented Jul 8, 2015

0.16.1 has been released that includes this fix

https://pypi.python.org/pypi/django-taggit/0.16.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment