Hi All:
My first Django project is an app to manage a repository of
downloadable software. Individual downloads have a category
(multimedia, internet, office, etc, etc) assigned to them. Releases of
the repository are made at regular intervals and a changelog is
maintained in between release to track items added to/changed/removed
from the repository. My models look like this:
-----begin-----
class Program(models.Model):
ratingChoices = (
(1, 'Essential'),
(2, 'Important'),
(3, 'Nice to Have'),
(4, 'Geeks Only'),
)
category = models.IntegerField(choices = categoryChoices)
rating = models.IntegerField(choices = ratingChoices)
name = models.CharField(max_length = 50)
version = models.CharField(max_length = 15)
description = models.TextField()
mainURL = models.URLField(verify_exists = False)
downloadURL = models.URLField(verify_exists = False)
installerPath = models.FileField(upload_to = 'downloads')
def __unicode__(self):
return str(self.name) + ' v' + str(self.version)
class Release(models.Model):
version = models.CharField(max_length = 15)
reldate = models.DateField()
def __unicode__(self):
return 'v' + str(self.version) + ' (' + str(self.reldate) +
')'
class ChangeLog(models.Model):
relVersion = models.ForeignKey('Release')
category = models.IntegerField(choices = categoryChoices)
logEntry = models.CharField(max_length = 100)
------end------
In the admin interface, I have the following:
-----begin-----
from django.contrib import admin
from winxpUtils.software.models import Program, Release, ChangeLog
class ProgramAdmin(admin.ModelAdmin):
list_display = ('name', 'version', 'category', 'rating')
ordering = ('name', 'category', 'rating')
list_filter = ('category', 'rating')
search_fields = ('description',)
class ChangeInline(admin.TabularInline):
model = ChangeLog
extra = 3
class ReleaseAdmin(admin.ModelAdmin):
list_display = ('version', 'reldate')
ordering = ('-version',)
inlines = [ChangeInline]
class ChangeLogAdmin(admin.ModelAdmin):
list_display = ('relVersion', 'category', 'logEntry')
ordering = ('category',)
list_filter = ('relVersion',)
admin.site.register(Program, ProgramAdmin)
admin.site.register(Release, ReleaseAdmin)
admin.site.register(ChangeLog, ChangeLogAdmin)
------end------
This all works the way I want it, with the exception of the
TabularInline thing for managing my 'Releases'. In the admin
interface, each ChangeLog row that I've tried to Inline gets given a
title of 'ChangeLog object'. I can't think of a particularly
articulate way to describe what I mean, so I've posted a partial
screen shot on my web site:
http://www.linux2000.com/django-admin.png
I'd like to get rid of the titles, but I can't find anything in the
tutorials or online docs that tells me how. Anybody got any
suggestions?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---