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

Migrations always include Alter field format_type on film #112

Closed
p-j-smith opened this issue Jun 27, 2024 · 1 comment · Fixed by #113
Closed

Migrations always include Alter field format_type on film #112

p-j-smith opened this issue Jun 27, 2024 · 1 comment · Fixed by #113
Assignees

Comments

@p-j-smith
Copy link
Collaborator

Definition of Done / Acceptance Criteria

Running python manage.py makemigrations doesn't (unnecessarily) include alterations to the format type of the Film model

Testing

Without making any changes to the code, run python manage.py makemigrations and check the Film model is not altered

Documentation

No response

Dependencies

No response

Comments

I think the format type always changes because FORMAT_CHOICES is a set:

FORMAT_CHOICES = {
("9.5", "9.5 mm"),
("16", "16 mm"),
("35", "35 mm"),
("70", "70 mm"),
("other", "Other"),
}
format_type = models.CharField(
max_length=5,
default="35",
verbose_name="format",
choices=FORMAT_CHOICES,

This means the order of the tuples is not guaranteed. Changing FORMAT_CHOICES to a list should resolve the issue

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 a pull request may close this issue.

2 participants
@p-j-smith and others