# HG changeset patch # User Bob Mourlam # Date 1320111523 18000 # Node ID abe08d74dab3d7b0f0558da6b699e5868bc295de # Parent 5348d2235497f70e23c9d8f5316b4571f23285f0# Parent 71f2beb037899cb21d0f8aa5bace7cefcb678ec2 I merged Chris' Reviews branch with mine. diff -r 5348d2235497 -r abe08d74dab3 bns_website/reviews/admin.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/reviews/admin.py Mon Oct 31 20:38:43 2011 -0500 @@ -0,0 +1,12 @@ +""" +Automatic admin definitions for the models in the reviews application. +""" +from django.contrib import admin +from reviews.models import Review + + +class ReviewAdmin(admin.ModelAdmin): + list_display = ['date', 'reviewer', 'review_site', 'title'] + + +admin.site.register(Review, ReviewAdmin) diff -r 5348d2235497 -r abe08d74dab3 bns_website/reviews/models.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/reviews/models.py Mon Oct 31 20:38:43 2011 -0500 @@ -0,0 +1,23 @@ +""" +Models for the reviews application. + +""" +from django.db import models + + +class Review(models.Model): + """ + This model represents all the info we store about each review. + """ + date = models.DateField(auto_now_add=True) + title = models.CharField(max_length=200, blank=True) + reviewer = models.CharField(max_length=200) + review_site = models.CharField(max_length=200, blank=True) + review_url = models.URLField(verify_exists=False, max_length=256, blank=True) + review = models.TextField() + + class Meta: + verbose_name_plural = "Reviews" + + def __unicode__(self): + return self.reviewer diff -r 5348d2235497 -r abe08d74dab3 bns_website/reviews/tests.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/reviews/tests.py Mon Oct 31 20:38:43 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 5348d2235497 -r abe08d74dab3 bns_website/reviews/views.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/reviews/views.py Mon Oct 31 20:38:43 2011 -0500 @@ -0,0 +1,1 @@ +# Create your views here. diff -r 5348d2235497 -r abe08d74dab3 bns_website/settings/base.py --- a/bns_website/settings/base.py Mon Oct 31 20:30:37 2011 -0500 +++ b/bns_website/settings/base.py Mon Oct 31 20:38:43 2011 -0500 @@ -136,6 +136,7 @@ 'core', 'bands', 'news', + 'reviews', ] # A sample logging configuration. The only tangible logging diff -r 5348d2235497 -r abe08d74dab3 bns_website/templates/core/navbar_tag.html --- a/bns_website/templates/core/navbar_tag.html Mon Oct 31 20:30:37 2011 -0500 +++ b/bns_website/templates/core/navbar_tag.html Mon Oct 31 20:38:43 2011 -0500 @@ -6,7 +6,7 @@ -


All News »

+


All News »

Reviews

@@ -102,7 +102,7 @@
  • Review number 2 goes here. - Oct. 12, 2011
  • Review number 1 goes here. - Oct. 2, 2011
  • -


    All Reviews »

    +


    All Reviews »

    Looking for more surf music?

    diff -r 5348d2235497 -r abe08d74dab3 bns_website/templates/reviews/review_list.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/templates/reviews/review_list.html Mon Oct 31 20:38:43 2011 -0500 @@ -0,0 +1,26 @@ +{% extends 'base.html' %} +{% load core_tags %} +{% block title %}Reviews{% endblock %} + +{% block custom_css %} + +{% endblock %} +{% block custom_js %} + + +{% endblock %} + +{% block content %} +{% navbar 'reviews' %} +

    Reviews

    + + + +{% endblock %} diff -r 5348d2235497 -r abe08d74dab3 bns_website/urls.py --- a/bns_website/urls.py Mon Oct 31 20:30:37 2011 -0500 +++ b/bns_website/urls.py Mon Oct 31 20:38:43 2011 -0500 @@ -5,6 +5,7 @@ from bands.models import Band from news.models import News +from reviews.models import Review admin.autodiscover() @@ -12,6 +13,9 @@ url(r'^$', TemplateView.as_view(template_name="home.html"), name="home"), + url(r'^reviews/$', + ListView.as_view(model=Review), + name="reviews"), url(r'^bands/$', ListView.as_view(model=Band), name="bands"),