Opened 18 years ago

Closed 18 years ago

Last modified 18 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: no UI/UX: no

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,
    

Change History (4)

comment:1 by anonymous, 18 years ago

Component: Contrib appsMetasystem

comment:2 by Gary Wilson <gary.wilson@…>, 18 years ago

milestone: Version 0.93Version 1.0

0.93 has come and gone.

comment:3 by josterhouse@…, 18 years ago

Resolution: duplicate
Status: newclosed

duplicate of #2243

comment:4 by (none), 18 years ago

milestone: Version 1.0

Milestone Version 1.0 deleted

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