#12475: Confusion between list_display and list_display_links for 'id' field -------------------------------------------+-------------------------------- Reporter: master | Owner: nobody Status: closed | Milestone: Component: django.contrib.admin | Version: 1.2-beta Resolution: worksforme | Keywords: Stage: Unreviewed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | -------------------------------------------+-------------------------------- Changes (by kmtracey):
* status: reopened => closed * resolution: => worksforme Comment: I cannot recreate any problem with `id` being include in `list_display` and `list_display_links`, on r13253. Given this model: {{{ #!python class TestModel(models.Model): name = models.CharField(max_length=40) birthdate = models.DateField(null=True, blank=True) birthtime = models.TimeField(null=True, blank=True) }}} The following model admin definition produces a correct change list page for `TestModel`: {{{ #!python class TMAdmin(admin.ModelAdmin): list_display = ('id', 'name', 'birthdate', 'birthtime') list_display_links = ('name',) }}} The ID for the model is shown, but is not a link to the change page for the instance; the name field is shown and is a link to the change page, the other two fields are displayed but not links. If I include `id` in `list_display_links` that works as well (the `id` value then also becomes a link to the change page), and if I omit `list_display_links` entirely then everything is still fine: in that case the `id` value is the one and only link to the change page for the instance. If you continue to see a problem on current code, please be more specific about your model and model admin definitions: given the current description I cannot find any problem. -- Ticket URL: <http://code.djangoproject.com/ticket/12475#comment:4> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.