Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#7237 closed (worksforme)

Many-to-many relationship on self - inherited model

Reported by: zgollum Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: qsrf-cleanup
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by ramiro)

I've inherited django.contrib.auth.User model

class MyUser(User):
        friends = models.ManyToManyField("self", symmetrical = False,
related_name = 'f_set')
        objects = UserManager()
        class Admin:

Other fields were removed for simplicity.

Now I run shell and:

u1 = MyUser.objects.create_user(username='test1',
email='', password='test')
u2 = MyUser.objects.create_user(username='test2',
email='', password='test')


[<MyUser: test1>]

[<MyUser: test2>]

So, I guess it's a bug. If you add a u3 and add it to the friends of

[<MyUser: test1>, <MyUser: test1>] 

Change History (6)

comment:1 Changed 8 years ago by gav

  • Keywords qsrf-cleanup added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 8 years ago by ramiro

  • Description modified (diff)

comment:3 Changed 8 years ago by jacob

  • milestone set to 1.0

comment:4 Changed 8 years ago by mtredinnick

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

Using exactly the example given here, this works fine for me with [7786] (it may well have been fixed as a side-effect of something else between the time or reporting and now). Please reopen if you are still seeing the problem, preferably with a patch against tests/regressiontests/model_inheritance_regress/ that shows a failing test.

comment:5 Changed 8 years ago by zgollum

Works! Great, thanks. I just knew that everything was going to be alright when Mike's back :)

comment:6 Changed 5 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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