#23473: Django prompts to create new migrations when none are needed when a
class
is used in a field declaration
----------------------------+--------------------
Reporter: dlo | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------
Create a model like so:
{{{
from django.db import models
from django.utils.deconstruct import deconstructible
@deconstructible
class IgnoreFormatString(object):
def __init__(self, s):
self.s = s
def __str__(self):
return self.s
def __mod__(self, k):
return self
class Product(models.Model):
name = models.CharField(max_length=32, blank=True, null=True,
error_messages={'invalid': IgnoreFormatString('At this time, we do not
carry half-sizes. We recommend rounding up.')})
}}}
Create a migration, and then run it. If you run "./manage.py migrate" once
again, you'll get prompted with
{{{
Your models have changes that are not yet reflected in a migration, and
so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run
'manage.py migrate' to apply them.
}}}
Running makemigrations will create another migration, yet this message
will continue to appear if the migration has already been applied.
--
Ticket URL: <https://code.djangoproject.com/ticket/23473>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/046.b1735965ac8488f99695efc2c774559f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.