Picture the following model and admin:
class Section(models.Model):
position = models.PositiveIntegerField(editable=False)
title = models.CharField(max_length=200)
class SectionAdmin(admin.ModelAdmin):
list_display = ['title']
ordering = [ 'position']
The position is a column that will be automatically populated. This column
is not editable and will not show up in the admin list display.
However, I would like to prevent the admin page from being able to sort on
any other column. The column headers need to not be clickable and
sort-able.
Is there any easy way to do this?
I have dug around the docs and looked through the source a good bit, but
couldn't find any straight-forward way of accomplishing this without
heavily customizing the admin app.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/hcDCJEs8IfcJ.
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-users?hl=en.