Skip to content

Closes #6414: Enable assigning prefixes to various object types #17692

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

Merged
merged 18 commits into from
Oct 18, 2024

Conversation

jeremystretch
Copy link
Member

Fixes: #6414

  • Add a scope GenericForeignKey on Prefix
  • Add denormalized relations on Prefix to the scope object types (region, site group, site, and location)
  • Populate scope & denormalized relations on migration
  • Remove the original site ForeignKey field from Prefix
  • Update PrefixFilterSet filters

@jeremystretch jeremystretch added this to the v4.2 milestone Oct 9, 2024
@jeremystretch jeremystretch marked this pull request as ready for review October 9, 2024 19:34
initial['scope'] = instance.scope
kwargs['initial'] = initial

super().__init__(*args, **kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

again seems like a good potential place for a mixin to reduce boilerplate as we are going to be using this same pattern in about 5 places.

@jeremystretch
Copy link
Member Author

Temporarily blocked by some prework for GFK bulk edit support in #17789

@jeremystretch jeremystretch added status: blocked Another issue or external requirement is preventing implementation and removed status: blocked Another issue or external requirement is preventing implementation labels Oct 17, 2024
@jeremystretch
Copy link
Member Author

There's an issue with generating filters for related models, because they're picking up the leading underscore of the ForeignKey fields. Trying to decide if we should ditch the underscores or adapt the dynamic logic to account for these (which will probably involve introspecting the model's filterset).

@jeremystretch jeremystretch merged commit 75270c1 into feature Oct 18, 2024
6 checks passed
@jeremystretch jeremystretch deleted the 6414-prefix-scope-gfk branch October 18, 2024 19:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2024
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