admin

How to add readonly inline on django admin

How to add readonly inline on django admin Question: I am using django 1.4 and I have a many2many field, so when creating the admin site I wanted to add this field as an inline, here is some code: class SummaryInline(admin.TabularInline): model = ParserError.summaries.through class MyClassAdmin(admin.ModelAdmin): list_display = (‘classifier’, ‘name’, ‘err_count’, ‘supported’) fields = (‘classifier’, …

Total answers: 4

How to display an uploaded image in "Change" page in Django Admin?

Django Admin Show Image from Imagefield Question: While I can show an uploaded image in list_display is it possible to do this on the per model page (as in the page you get for changing a model)? A quick sample model would be: Class Model1(models.Model): image = models.ImageField(upload_to=directory) The default admin shows the url of …

Total answers: 14

Adding a jQuery script to the Django admin interface

Adding a jQuery script to the Django admin interface Question: I’m gonna slightly simplify the situation. Let’s say I’ve got a model called Lab. from django.db import models class Lab(models.Model): acronym = models.CharField(max_length=20) query = models.TextField() The field query is nearly always the same as the field acronym. Thus, I’d like the query field to …

Total answers: 1

Unable log in to the django admin page with a valid username and password

Unable log in to the django admin page with a valid username and password Question: I can’t log in to the django admin page. When I enter a valid username and password, it just brings up the login page again, with no error messages This question is in the django FAQ, but I’ve gone over …

Total answers: 26

DateTimeField doesn't show in admin system

DateTimeField doesn't show in admin system Question: How come my “date” field doesn’t come up in the admin system? In my admin.py file i have from django.contrib import admin from glasses.players.models import * admin.site.register(Rating) and the Rating model has a field called “date” which looks like this date = models.DateTimeField(editable=True, auto_now_add=True) However within the admin …

Total answers: 10