Django

Code

Ticket #452 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

Two ManyToManyFields to the same object should give that other object two API methods, not one

Reported by: leo@exoweb.net Assigned to: adrian
Milestone: Component: Metasystem
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description (Last modified by adrian)

I create two m2mfields which reference to the same class, such as this:

class Name(Model):
    name = CharField (maxlength=50)
    def __repr__(self):
        return self.name

class People(Model):
    first_name = ManyToManyField (Name)
    last_name = ManyToManyField (Name)

    def __repr__(self):
        return self.first_name

I get two tables in DB: app_peoples_first_name and app_peoples_last_name

And i also get three apis: set_first_name, set_last_name and get_name_list

while i think there should be two gets here: get_first_name_list and get_last_name_list.

Attachments

Change History

09/02/05 13:19:34 changed by adrian

  • description changed.

Cleaned up formatting in description.

09/02/05 13:19:58 changed by adrian

  • status changed from new to assigned.

09/02/05 13:46:48 changed by adrian

  • summary changed from M2MField doesn't work. to Two ManyToManyFields to the same object should give that other object two API methods, not one.

09/02/05 13:46:55 changed by adrian

  • component changed from Admin interface to Metasystem.

09/03/05 03:57:40 changed by upadhyay@gmail.com

Isn't this a duplicate of Ticket #327, which is marked fixed?

09/25/05 17:17:46 changed by adrian

  • milestone set to Version 1.0.

11/30/05 23:46:19 changed by adrian

(In [1513]) Improved model validator to throw error if a model has two ManyToMany? relationships to the same model and doesn't set 'singular'. Refs #452.

12/01/05 00:01:48 changed by adrian

(In [1515]) Added unit tests to confirm #452. Refs #452.

12/01/05 00:02:47 changed by adrian

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [1516]) Fixed #452 -- Fixed bug in generated DB API for models that have two ManyToManyFields? to the same related model.

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

  • milestone deleted.

Milestone Version 1.0 deleted


Add/Change #452 (Two ManyToManyFields to the same object should give that other object two API methods, not one)




Change Properties
Action