I have a model with lots of say CharField
fields, that I would like to edit in the admin.
The problem is that each field takes up one line. How should I make them display like this (horizontally):
(source: djangoproject.com)
(they are not foreign keys)
You can fully customize the admin by changing the templates used to render pages. The Django template engine has a defined order for loading templates. When it loads a template, it uses the first template that matches the name. You can override admin templates by using the same directory structure and file names.
Django's Admin is amazing. A built-in and fully functional interface that quickly gets in and allows data entry is priceless. Developers can focus on building additional functionality instead of creating dummy interfaces to interact with the database.
The Django admin application can use your models to automatically build a site area that you can use to create, view, update, and delete records. This can save you a lot of time during development, making it very easy to test your models and get a feel for whether you have the right data.
Django 1.2 has ListEdit extension for the Admin
This is how you use it:
class AccountAdmin(admin.ModelAdmin):
list_display = ( 'Name','Type')
list_editable = ( 'Type', )
And this is how it looks like:
(source: v-lad.org)
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