Sunday, April 29, 2018

updating model breaks admin

If the data is not important, try to delete migration files from `migrations` package, drop the database tables and reference M2M relationship using strings:

tags = models.ManyToManyField('Tag')

Or if the Tag model is in another app:

tags = models.ManyToManyField('app_name.Tag')

Then run `makemigrations` and `migrate`

Can you also share the `Tag` model and related `ModelAdmin` classes?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9d251f4a-b4ea-48b0-946b-458ea6f2957d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment