Code

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#2424 closed defect (duplicate)

Django_admin will report errors when try to save objects, where another object, which has a many_to_many field, is edit_inlined

Reported by: chengqi@… Owned by: jacob
Component: Metasystem Version: magic-removal
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Descriptions

  • Django_admin will report errors when try to save objects, where another object, which has a many_to_many field, is edit_inlined

This is my model

Class A:
    ....

Class B:
    field = ManyToManyField(ClassC);
    a = ForeignKey(A, edit_inline=meta.STACKED)

Reproduce steps

  • Then when I try to create a A object in django_admin, it will report errors as 'set_field' not exist..

Django codes related

django/db/models/manipulator.py

  • line 217
    for f in related.opts.many_to_many:
       if child_follow.get(f.name, None) and not f.rel.edit_inline:
            was_changed = getattr(new_rel_obj, 'set_%s' % f.name)(rel_new_data[f.attname])
       if self.change and was_changed:
            self.fields_changed.append('%s for %s "%s"' % (f.verbose_name, related.opts.verbose_name,
    

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by anonymous

  • Component changed from Contrib apps to Metasystem

comment:2 Changed 8 years ago by Gary Wilson <gary.wilson@…>

  • milestone changed from Version 0.93 to Version 1.0

0.93 has come and gone.

comment:3 Changed 8 years ago by josterhouse@…

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

duplicate of #2243

comment:4 Changed 7 years ago by anonymous

  • milestone Version 1.0 deleted

Milestone Version 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.