#21498: Changing locale causes migrations autodetector to make unnecesary
changes
---------------------------------+----------------------------------------
Reporter: foonicorn | Owner: andrewgodwin
Type: Bug | Status: closed
Component: Migrations | Version: master
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------
Comment (by tcx):
I can reproduce it on 1.7.2.
Started the project with
{{{
LANGUAGE_CODE = 'cs'
LANGUAGES = ( ('cs', 'Czech'), ('en', 'English'), )
USE_I18N = True
}}}
all model fields with verbose_name in Czech like
{{{
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Book(models.Model):
name = models.CharField(_(u'Název'), max_length=255)
}}}
initial migration
{{{
('name', models.CharField(max_length=255, verbose_name='N\xe1zev')),
}}}
after I've added en locale and translated "Název" as "Title"
makemigrations shows
{{{
migrations.AlterField(
model_name='book',
name='name',
field=models.CharField(max_length=255, verbose_name='Title'),
preserve_default=True,
),
}}}
when I import _ in models.py just as ugettext (not ugettext_lazy) problem
disappears.
--
Ticket URL: <https://code.djangoproject.com/ticket/21498#comment:19>
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/067.397da5760a0144fe078a3af51101bee6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.