# HG changeset patch # User Bob Mourlam # Date 1320028425 18000 # Node ID 2de51cc51d3a31cbf266bd296ba32194a47ab231 # Parent 40d86ae48db19068e3988aab02d76ce321eabd2b My first stab at the news app. The template is a little dull, but it's a start. diff -r 40d86ae48db1 -r 2de51cc51d3a bns_website/bands/admin.py --- a/bns_website/bands/admin.py Sun Oct 30 18:29:41 2011 -0500 +++ b/bns_website/bands/admin.py Sun Oct 30 21:33:45 2011 -0500 @@ -4,11 +4,12 @@ """ from django.contrib import admin from bands.models import Band +from news.models import News class BandAdmin(admin.ModelAdmin): list_display = ['name', 'url', 'order'] list_editable = ['order'] - admin.site.register(Band, BandAdmin) +admin.site.register(News) diff -r 40d86ae48db1 -r 2de51cc51d3a bns_website/news/models.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/news/models.py Sun Oct 30 21:33:45 2011 -0500 @@ -0,0 +1,21 @@ +from django.db import models + +# Create your models here. +class News(models.Model): + """ + This model represents all the info we store about each news entry. + + """ + title = models.CharField(max_length=128) + date = models.DateTimeField() + content = models.TextField() + + # User field? + + + + class Meta: + verbose_name_plural="News" + + def __unicode__(self): + return self.title diff -r 40d86ae48db1 -r 2de51cc51d3a bns_website/news/tests.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/news/tests.py Sun Oct 30 21:33:45 2011 -0500 @@ -0,0 +1,16 @@ +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this with more appropriate tests for your application. +""" + +from django.test import TestCase + + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.assertEqual(1 + 1, 2) diff -r 40d86ae48db1 -r 2de51cc51d3a bns_website/news/views.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/news/views.py Sun Oct 30 21:33:45 2011 -0500 @@ -0,0 +1,1 @@ +# Create your views here. diff -r 40d86ae48db1 -r 2de51cc51d3a bns_website/settings/base.py --- a/bns_website/settings/base.py Sun Oct 30 18:29:41 2011 -0500 +++ b/bns_website/settings/base.py Sun Oct 30 21:33:45 2011 -0500 @@ -135,6 +135,7 @@ 'django.contrib.admindocs', 'core', 'bands', + 'news', ] # A sample logging configuration. The only tangible logging diff -r 40d86ae48db1 -r 2de51cc51d3a bns_website/templates/core/navbar_tag.html --- a/bns_website/templates/core/navbar_tag.html Sun Oct 30 18:29:41 2011 -0500 +++ b/bns_website/templates/core/navbar_tag.html Sun Oct 30 21:33:45 2011 -0500 @@ -5,7 +5,7 @@ Brave New Surf