-
-
Notifications
You must be signed in to change notification settings - Fork 152
Open
Description
- Create a demo project(eg. mysite, https://docs.djangoproject.com/en/4.0/intro/tutorial01/)
- Change models.py and migrations(No problem)
from django.db import models
from sortedm2m.fields import SortedManyToManyField
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
choice_order = SortedManyToManyField("Choice", related_name='choice_order', blank=True)
class Choice(models.Model):
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)
- Make some data for Question and Choice.
- change choice_order to choices (models.py)
- python3 manage.py makemigrations (will generate something like this migrations.RenameField(
model_name='question',
old_name='choice_order',
new_name='choices',
)) - python3 manage.py migrate
- django.db.utils.IntegrityError: NOT NULL constraint failed: polls_question_choices.sort_value
I don't know how to contact you and I alse don't know whether django-sortedm2m support migrations.RenameField.
Could you have a look this problem when you're free.
Thank you
Metadata
Metadata
Assignees
Labels
No labels