#30260: ManyToManyField with a non-list default value has different behavior in
an
inlined Admin vs a standalone Admin
-------------------------------------+-------------------------------------
Reporter: Merlijn | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 2.1
Severity: Normal | Resolution: invalid
Keywords: ManyToManyField, | Triage Stage:
Inline, Admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):
* status: new => closed
* resolution: => invalid
Comment:
Hi. Thanks for the report.
> Instead of default=3 on the Book model, we can change it to default=[3]
and everything works like a charm.
You've hit the nail on the head here. A scalar value doesn't make sense as
the default for a `ManyToManyField`.
**Possibly** we could add some kind of check that default values had
sensible values, but it's not at all clear that would be worth the effort,
we're in a dynamic language so this kind of thing can happen and, short of
a concrete suggestion this isn't really actionable as is.
As such I'm going to close this. I hope that makes sense.
--
Ticket URL: <https://code.djangoproject.com/ticket/30260#comment:1>
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.ce924bf25b04e64b7e4020311a96c4e8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.