Wednesday, July 1, 2015

a simple software listing app.

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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5594CB23.6060704%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment