Django

Code

Ticket #2424 (closed: duplicate)

Opened 3 years ago

Last modified 2 years ago

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@exoweb.net Assigned to: jacob
Milestone: Component: Metasystem
Version: magic-removal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

Change History

07/26/06 04:14:20 changed by anonymous

  • component changed from Contrib apps to Metasystem.

08/13/06 00:37:04 changed by Gary Wilson <gary.wilson@gmail.com>

  • milestone changed from Version 0.93 to Version 1.0.

0.93 has come and gone.

08/23/06 09:46:07 changed by josterhouse@gmail.com

  • status changed from new to closed.
  • resolution set to duplicate.

duplicate of #2243

01/17/07 16:12:17 changed by

  • milestone deleted.

Milestone Version 1.0 deleted


Add/Change #2424 (Django_admin will report errors when try to save objects, where another object, which has a many_to_many field, is edit_inlined)




Change Properties
Action