a simple software listing app.

15 views
Skip to first unread message

derek riemer

unread,
Jul 2, 2015, 1:25:32 AM7/2/15
to django...@googlegroups.com
I have a model that represents a list of software. This way pieces of
software can be added interactivly.

from django.db import models

# Create your models here.


class Software(models.Model):
name = models.CharField(max_length=50)
programming_language = models.CharField(max_length=50)
discription = models.TextField()
git_hub_url = models.URLField(blank=True)
the_file = models.URLField(blank=True)
latest_version = models.CharField(max_length=10) #xx.yy.zz/ some letter
published_on = models.DateField()

def __str__(self):
return self.name+", version "+str(self.latest_version)+",
written in "+self.programming_language+", published on
"+self.published_on.strftime("%x")




I am curious on how I can adapt that particular apps admin page to have
a title of software list, but keep the default title of my admin site
for the whole app, or better yet change the site title for my admin site?
My software_list/admin.py looks like this,
from django.contrib import admin
from .models import Software
from django.contrib.admin import AdminSite


class MyAdminSite(AdminSite):
site_header = 'Monty Python administration'

admin_site = MyAdminSite(name='software_list')
#admin_site.register(Software)



admin.site.register(Software)

and my derek_site/admin.py is empty. Note that derek_site is my websites
root app, and I use url conf's and includes to import the other things,
i.e. a portfolio, personal website ... which live in separate apps.



Thanks,
Derek
Reply all
Reply to author
Forward
0 new messages