#23628: AlterModelOptions should check for changes
----------------------------+--------------------
Reporter: Naddiseo | 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
----------------------------+--------------------
Consider the following model:
{{{
#!python
PERM_DEFS = {
('perm1', 'Desc1') : 123,
('perm2', 'Desc2') : 321
}
class Spam(models.Model):
class Meta:
permissions = list(PERM_DEFS.keys())
}}}
Currently, running `makemigrations` will always generate a new migration
even though the permissions list doesn't change. Perhaps the inspector
could do a `set(old_attr) == set(new_attr)` type operation on list style
attributes such as `permissions` and `default_permissions`.
Current workaround is: `permissions = list(sorted(PERM_DEFS.keys()))`
--
Ticket URL: <https://code.djangoproject.com/ticket/23628>
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/051.be2cd8190265c09cc59faba0a80e7b8e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.