Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6250 closed (duplicate)

recursion loop on ForeignKey('self',edit_inline=True)

Reported by: anonymous Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

maybe it's a variant of #3288 bug. This is the case:

class Test(models.Model):
	recursion_loop = models.ForeignKey('self',edit_inline=models.TABULAR)
...many many lines...
  File "/home/visi/djtrunk/django/db/models/related.py", line 99, in get_follow
    return self.opts.get_follow(over)
  File "/home/visi/djtrunk/django/db/models/options.py", line 177, in get_follow
    fol = f.get_follow(child_override)
  File "/home/visi/djtrunk/django/db/models/related.py", line 99, in get_follow
    return self.opts.get_follow(over)
  File "/home/visi/djtrunk/django/db/models/options.py", line 177, in get_follow
    fol = f.get_follow(child_override)
  File "/home/visi/djtrunk/django/db/models/related.py", line 99, in get_follow
    return self.opts.get_follow(over)
  File "/home/visi/djtrunk/django/db/models/options.py", line 177, in get_follow
    fol = f.get_follow(child_override)
  File "/home/visi/djtrunk/django/db/models/related.py", line 99, in get_follow
    return self.opts.get_follow(over)
  File "/home/visi/djtrunk/django/db/models/options.py", line 177, in get_follow
    fol = f.get_follow(child_override)
  File "/home/visi/djtrunk/django/db/models/fields/__init__.py", line 372, in get_follow
    if override != None:
RuntimeError: maximum recursion depth exceeded in cmp

Change History (5)

comment:1 Changed 7 years ago by Simon Greenhill <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

What version of Django is this? Trunk or 0.96?

comment:2 Changed 7 years ago by MarcoBazzani <alfred.einstein@…>

  • Resolution invalid deleted
  • Status changed from closed to reopened

trunk as selected in the options
still same problem

comment:3 Changed 7 years ago by ramiro

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

Marking this as duplicate of #3288 that has comments from core devs and has been fixed on the queryset refactor branch. This ticket has no clear instructions on how to reproduce the behavior but the symptom reported (traceback) is the same.

comment:4 Changed 7 years ago by MarcoBazzani

I've reported the instruction to reproduce it
it's enought to create this model

class Test(models.Model):
	recursion_loop = models.ForeignKey('self',edit_inline=models.TABULAR)

comment:5 Changed 7 years ago by MarcoBazzani

anyway yes it's duplicated

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