We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Django creates AlterField migrations when the choices of a field change. This means that, because of this line:
task = models.CharField(max_length=200, choices=task_list())
Django wants to make a migration every time the task list is updated. I'm wondering if something like
self._meta.get_field_by_name('task')[0]._choices = task_list()
inside __init__ could work instead. That said, get_field_by_name is about to be deprecated and should probably simply be get_field.
__init__
get_field_by_name
get_field
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Django creates AlterField migrations when the choices of a field change. This means that, because of this line:
task = models.CharField(max_length=200, choices=task_list())
Django wants to make a migration every time the task list is updated. I'm wondering if something like
self._meta.get_field_by_name('task')[0]._choices = task_list()
inside
__init__
could work instead. That said,get_field_by_name
is about to be deprecated and should probably simply beget_field
.The text was updated successfully, but these errors were encountered: