#13825: Primary key is not displayed properly on an editable changelist view 
under
the admin
-----------------------------------------------------+----------------------
          Reporter:  [email protected]  |         Owner:  nobody
            Status:  closed                          |     Milestone:        
         Component:  django.contrib.admin            |       Version:  1.2   
        Resolution:  duplicate                       |      Keywords:        
             Stage:  Unreviewed                      |     Has_patch:  0     
        Needs_docs:  0                               |   Needs_tests:  0     
Needs_better_patch:  0                               |  
-----------------------------------------------------+----------------------
Changes (by kmtracey):

  * status:  new => closed
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0
  * resolution:  => duplicate

Old description:

> Description of the Problem:
>
> Primary key does not display properly on the changelist view when it is
> set under the list_display option and not set under list_display_links
> option, when another field has been set under the list_editable; the
> primary key gets encapsulated in a hidden field.
>
> Steps to Reproduce Error:
>
> -Set the primary key to display under the admin through the list_display
> option; along with two other fields
> -Set one of the other fields to the list_display_links option
> -Set last field to the list_editable option
>

> Example:
>
> Models.py
>
> class Test_Image(models.Model):
>     filename = models.CharField(max_length=20, primary_key=True)
>     display_name = models.CharField(max_length=255)
>     sort_order = models.IntegerField()
>     last_modified_date = models.DateField(editable=False, auto_now=True)
>

> Admin.py
>
> class TestImageAdmin(admin.ModelAdmin):
>     list_display = ('display_name', 'filename', 'sort_order',)
>     list_display_links = ('display_name',)
>     list_editable = ('sort_order',)

New description:

 Description of the Problem:

 Primary key does not display properly on the changelist view when it is
 set under the list_display option and not set under list_display_links
 option, when another field has been set under the list_editable; the
 primary key gets encapsulated in a hidden field.

 Steps to Reproduce Error:

  * Set the primary key to display under the admin through the list_display
 option; along with two other fields
  * Set one of the other fields to the list_display_links option
  * Set last field to the list_editable option


 Example:

 Models.py
 {{{
 #!python
 class Test_Image(models.Model):
     filename = models.CharField(max_length=20, primary_key=True)
     display_name = models.CharField(max_length=255)
     sort_order = models.IntegerField()
     last_modified_date = models.DateField(editable=False, auto_now=True)
 }}}

 Admin.py
 {{{
 #!python
 class TestImageAdmin(admin.ModelAdmin):
     list_display = ('display_name', 'filename', 'sort_order',)
     list_display_links = ('display_name',)
     list_editable = ('sort_order',)
 }}}

Comment:

 Fixed formatting, please use preview.

 This problem is already described in #12475.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13825#comment:1>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to