i have went through the Poll tutorial on http://docs.djangoproject.com.
I would like to know if it is possible to add a sort order to the 'Choice' Model when editing a Poll and how would i accomplish that
thanks
Django provides a built-in admin module which can be used to perform CRUD operations on the models. It reads metadata from the model to provide a quick interface where the user can manage the content of the application. This is a built-in module and designed to perform admin related tasks to the user.
class SeminarInline(admin.StackedInline): model = Seminar extra = 0 ordering = ('-date',)
worked for me (above adapted from my model) It sorted in descending date order
You can add Meta
options to a Django model which can dictate how it behaves. There is an ordering
option which defines by which model attribute records should be ordered.
You can find the documentation for the meta ordering option here in the Django docs:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With