Django fix Admin plural

How do I change some models name from “Categorys” to “Categories” on admin site in the new dev django version? In the old version (whithout admin sites and admin models) you could just do this; http://www.the-dig.com/blog/post/customize-plural-name-django-admin/ However – now setting verbose_name_plural inside my modeladmin based class does nothing. Anyone encouter the same issue? 2 Answers … Read more

Getting Django admin url for an object

Before Django 1.0 there was an easy way to get the admin url of an object, and I had written a small filter that I’d use like this: <a href=”https://stackoverflow.com/questions/694477/{{ object”admin_url }}” …. > … </a> Basically I was using the url reverse function with the view name being ‘django.contrib.admin.views.main.change_stage’ reverse( ‘django.contrib.admin.views.main.change_stage’, args=[app_label, model_name, object_id] … Read more

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 null [Sun Nov 15 02:18:12 2009] [error] return self.cursor.execute(query, args) The relevant part of my database is: `created` datetime NOT … Read more

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 the obvious methods … Read more