Opened 16 years ago

Last modified 13 years ago

#10784 closed

list_editable will not work for the default ordering field. — at Version 2

Reported by: andrepleblanc@… Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Alex Gaynor)

specifying a DateField as list_editable AND in the ordering of a model's Meta causes an error message stating 'Please correct the errors below' but doesn't list any errors.

eg.

class TestModel(models.Model):
    name = models.CharField(max_length=40)
    birthdate = models.DateField(null=True, blank=True)
    class Meta:
        ordering = ('birthdate',)

class TestModelAdmin(admin.ModelAdmin):
    list_display = ('name', 'birthdate')
    list_editable = ('birthdate', )

the birthdate field cannot actually be edited on the change list, it just shows that unhelpful message. Not sure if this applies to all Field types or not, but definitely DateFields.

Change History (2)

comment:1 by andrepleblanc@…, 16 years ago

sorry, the code didn't come out as I had hoped, but I'm sure the problem is clear.

comment:2 by Alex Gaynor, 16 years ago

Description: modified (diff)

Please use preview

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