Fix Python – Resize fields in Django Admin

Django tends to fill up horizontal space when adding or editing entries on the admin, but, in some cases, is a real waste of space, when, i.e., editing a date field, 8 characters wide, or a CharField, also 6 or 8 chars wide, and then the edit box goes up to 15 or 20 chars.
How can I tell the admin how wide a textbox should be, or the height of a T….

Fix Python – How to override and extend basic Django admin templates?

How do I override an admin template (e.g. admin/index.html) while at the same time extending it (see https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-vs-replacing-an-admin-template)?
First – I know that this question has been asked and answered before (see Django: Overriding AND extending an app template) but as the answer says ….

Fix Python – Multiple ModelAdmins/views for same model in Django admin

How can I create more than one ModelAdmin for the same model, each customised differently and linked to different URLs?
Let’s say I have a Django model called Posts. By default, the admin view of this model will list all Post objects.
I know I can customise the list of objects displayed on the page in various ways by setting variables like list_di….

Fix Python – Django Admin – Disable the ‘Add’ action for a specific model

I have a django site with lots of models and forms. I have many custom forms and formsets and inlineformsets and custom validation and custom querysets. Hence the add model action depends on forms that need other things, and the ‘add model’ in the django admin throughs a 500 from a custom queryset.
Is there anyway to disable the ‘Add $MODEL’ funct….

Fix Python – Django auto_now and auto_now_add

For Django 1.1.
I have this in my models.py:
class User(models.Model):
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)

When updating a row I get:
[Sun Nov 15 02:18:12 2009] [error] /home/ptarjan/projects/twitter-meme/django/db/backends/mysql/base.py:84: Warning: Column ‘created’ cannot be n….

Fix Python – Can “list_display” in a Django ModelAdmin display attributes of ForeignKey fields?

I have a Person model that has a foreign key relationship to Book, which has a number of fields, but I’m most concerned about author (a standard CharField).
With that being said, in my PersonAdmin model, I’d like to display book.author using list_display:
class PersonAdmin(admin.ModelAdmin):
list_display = [‘book.author’,]

I’ve tried all of t….