Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #14153: Filter ContentTypes by supported feature #14191

Merged
merged 6 commits into from
Nov 16, 2023

Conversation

jeremystretch
Copy link
Member

Fixes: #14153

  • Add a with_feature() method to the manager for our ContentType proxy model
  • Replace all uses of FeatureQuery with the new method
  • Remove FeatureQuery
  • Update all ForeignKey references to ContentType to use a string name (rather than the class itself) to simplify imports and avoid migration errors with GenericForeignKeys

@jeremystretch jeremystretch added this to the v3.7 milestone Nov 6, 2023
@@ -21,6 +21,24 @@ def public(self):
q |= Q(app_label=app_label, model__in=models)
return self.get_queryset().filter(q)

def with_feature(self, feature):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a part of this PR, but I think we should have a FR to document the registry as it is getting a bit complicated now, for example for a model-feature what it is for, you need to do the following steps (like in the clean validate the content-type), etc...

Copy link
Member Author

Choose a reason for hiding this comment

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

We have a page in the developer docs that explains each store. Happy to flesh this out some. (And your comment reminded me to go add the new tables store introduced under #14173.)

@jeremystretch jeremystretch merged commit e15647a into feature Nov 16, 2023
8 checks passed
@jeremystretch jeremystretch deleted the 14153-replace-featurequery branch November 16, 2023 17:13
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants