Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Mar 2, 2021

This addresses issues wagtail users have had using similar_objects() with ClusterTaggableManager

This PR would resolve both #424 and #508 and close issue #80.

It is an updated and rebased version of the commits made in #424 by nickhudkins.

It finishes the work in PR #424 in that drops the workarounds for older versions of Django as requested by @jdufresne in #424.

@codecov
Copy link

codecov bot commented Mar 2, 2021

Codecov Report

Merging #712 (a876321) into master (b08ed6d) will increase coverage by 1.64%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #712      +/-   ##
==========================================
+ Coverage   91.43%   93.07%   +1.64%     
==========================================
  Files           3        8       +5     
  Lines         432      621     +189     
  Branches       78       93      +15     
==========================================
+ Hits          395      578     +183     
- Misses         23       25       +2     
- Partials       14       18       +4     
Impacted Files Coverage Δ
taggit/managers.py 90.80% <100.00%> (+0.02%) ⬆️
taggit/admin.py 100.00% <0.00%> (ø)
taggit/__init__.py 100.00% <0.00%> (ø)
taggit/models.py 98.23% <0.00%> (ø)
taggit/forms.py 100.00% <0.00%> (ø)
taggit/views.py 86.20% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b08ed6d...a876321. Read the comment docs.

@ghost
Copy link
Author

ghost commented Mar 2, 2021

At first glance it looks like a problem with the test scripts for 3.6 and 3.7 and not an issue with this PR. Can a JazzBand maintainer confirm?

@ghost
Copy link
Author

ghost commented Mar 2, 2021

Test scripts for 3.6 and 3.7 are attempting to use a version of Django that no longer supports python 3.6 and 3.7. Looks like these test builds could be dropped, or they need to be edited to specify an older version of Django.

)

class Meta:
unique_together = [["content_object", "tag"]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of unique_together you could try UniqueContraint

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are about a half dozen occurrences of unique_together in this file, and none of them have been switched over to UniqueConstraint yet. I think for clarity, as this would be an unrelated change, it would be better to change all the unique-together to UniqueConstraint with its own issue / PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UniqueConstraint was introduced in Django 2.2, so if I'm not mistaken, this would also mean the min version of Django would have to be bumped to 2.2 and version 1 support would have to be dropped. This is probably fine at this point, but it is also beyond the scope of this PR.

@ghost
Copy link
Author

ghost commented Mar 3, 2021

Django 4.0 has dropped support for python 3.6,3.7.
As such, I modified the tox test script so that it doesn't test python 3.6 and 3.7 against django master, which has been updated to support >=3.8.

("title", models.CharField(max_length=100)),
],
),
migrations.CreateModel(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you created the migrations yourselves? are they going to break the downward migrations?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you created the migrations yourselves?

Yes.

are they going to break the downward migrations?

Please review them. The tests are passing.

@ghost
Copy link
Author

ghost commented Mar 5, 2021

@auvipy, please let me know if there is anything else I can do to help get this fix in. If there is some other way to demonstrate the migrations I added are correct, let me know and I'll try to do that over the weekend.

@ghost
Copy link
Author

ghost commented Mar 10, 2021

@auvipy, I removed my manual migrations and added a migrations file with django's generated migration. I rebased onto @jezdez test updates so the two PR's are consitent.
Tests are all passing and test migrations are fixed.

@ghost
Copy link
Author

ghost commented Mar 12, 2021

#599 can also be closed when this is merged in.

@jdufresne
Copy link
Member

@auvipy I'm no longer actively using or maintaining django-taggit. Please feel free to review, merge, and release as you see fit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants