Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2262 closed defect (duplicate)

[patch] ManyToManyField with blank=True errors out when the field is blank

Reported by: rayners@… Owned by: adrian
Component: Database layer (models, ORM) Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I have a ManyToManyField with blank=True in a model that is in being edited inline, and whenever I add a new item with a blank entry in that field, I would receive an error about missing set_fieldname.

So I threw together a quick patch and it is working for me currently. This is my first stab at working with Django, so the logic may be a bit off.

Attachments (1)

django-db-models-manipulators.diff (914 bytes) - added by rayners@… 9 years ago.
Patch to check for blank ManyToManyField

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by rayners@…

Patch to check for blank ManyToManyField

comment:1 Changed 9 years ago by rayners@…

  • Summary changed from ManyToManyField with blank does errors out when the field is blank to [patch] ManyToManyField with blank=True errors out when the field is blank

comment:2 Changed 9 years ago by russellm

  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #1816.

The actual problem isn't quite as described. The issue is that the set_fieldname method is a remnant of pre-magic removal. The blank=True is a red herring in this case.

Note: See TracTickets for help on using tickets.
Back to Top