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

Exclude limit_choices_to attribute from field deconstruction for migration planning #10136

Open
jeremystretch opened this issue Aug 24, 2022 · 1 comment
Labels
netbox status: backlog Awaiting selection for work type: housekeeping Changes to the application which do not directly impact the end user

Comments

@jeremystretch
Copy link
Member

jeremystretch commented Aug 24, 2022

Proposed Changes

Extend our custom field deconstruction method to exclude a field's limit_choices_to attribute in addition to choices, help_text, and verbose_name (which are already excluded).

Justification

Changes to the limit_choices_to attribute on a field do not effect a database schema change. (In fact, we have many instances where the use of FeatureQuery() results in the dynamic calculation of acceptable values at runtime.) Excluding this attribute from consideration avoids creating "no-op" migrations which clutter the application.

@jeremystretch jeremystretch added the type: housekeeping Changes to the application which do not directly impact the end user label Aug 24, 2022
@jeremystretch jeremystretch self-assigned this Aug 24, 2022
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Aug 24, 2022
@jeremystretch
Copy link
Member Author

We can actually ignore related_name and related_query_name as well, and simply bypass RelatedField's deconstruct() method entirely. We'll need to do some extensive testing before implementing this change, however.

@jeremystretch jeremystretch removed their assignment Aug 24, 2022
@jeremystretch jeremystretch added status: backlog Awaiting selection for work and removed status: accepted This issue has been accepted for implementation labels May 22, 2024
@jeremystretch jeremystretch added the netbox label Nov 1, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
netbox status: backlog Awaiting selection for work type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

1 participant