{{{
class MyModel(models.Model):
trailing_comma = models.IntegerField(),
}}}
Django silently ignored the field, possibly leaving you wondering for a
very long time what's going on.
I suggest to add a warning to the models checker framework.
If accepted, I'm willing to come up with an initial patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/31771>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => wontfix
* ui_ux: 1 => 0
* component: Database layer (models, ORM) => Core (System checks)
Comment:
Thanks for this ticket, however we cannot add a system check for tuples
defined on models. It's a supported use case.
--
Ticket URL: <https://code.djangoproject.com/ticket/31771#comment:1>
Comment (by Jonas Haag):
What do you mean by “supported use case”? Obviously defining tuples on
model classes generally should not raise a warning, but how about the
specific case of tuple of size 1 containing a model field instance?
--
Ticket URL: <https://code.djangoproject.com/ticket/31771#comment:2>
Comment (by Jonas Haag):
From a quick Google search, this seems to be a common mistake made by a
Django beginners.
https://stackoverflow.com/questions/7900162/django-error-with-
orm/7900323#7900323
https://stackoverflow.com/questions/26090949/unique-together-refers-to-
the-non-existent-field
https://stackoverflow.com/questions/4389367/django-unique-together-does-
not-allow-foreignkey-field-across-applications-when
--
Ticket URL: <https://code.djangoproject.com/ticket/31771#comment:3>
Comment (by felixxm):
It is too specific, we cannot add separate system checks for each kind of
typos.
--
Ticket URL: <https://code.djangoproject.com/ticket/31771#comment:4>