Opened 17 years ago

Last modified 16 years ago

#3914 closed

Self-referencing keys in the list_display kills development server with no error thrown — at Version 1

Reported by: adamfast@… Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords: self-reference list_display
Cc: None Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Adrian Holovaty)

If you use this model:

class Page(models.Model):
    title = models.CharField(maxlength=192)
    default = models.BooleanField()
    template = models.CharField(maxlength=256)
    parent = models.ForeignKey('Page')
    sequence = models.IntegerField()
    visible_on_menu = models.BooleanField()
    defined_header = models.CharField(maxlength=256)
    date_of_creation = models.DateTimeField()
    class Admin:
        list_display = ['title','parent','visible_on_menu']

And try to go to the model in the admin interface, the development server just dies. There is no error, it just goes back to a command prompt waiting.

This model is to be used for a newforms-like setup that can have parent/child pages for building heirarchical navigation menus - and it will be handy to see the parent in the display.

Change History (1)

comment:1 by Adrian Holovaty, 17 years ago

Description: modified (diff)

(Fixed formatting in description.)

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