From 1011b48877e4239d52834b694269c0ba59426f5d Mon Sep 17 00:00:00 2001 From: sanj Date: Wed, 9 Jun 2010 20:00:34 +0530 Subject: [PATCH] added files/ --- index/books/models.py | 3 +++ index/files/__init__.py | 0 index/files/models.py | 8 ++++++++ index/files/tests.py | 23 +++++++++++++++++++++++ index/files/views.py | 1 + 5 files changed, 35 insertions(+) create mode 100644 index/files/__init__.py create mode 100644 index/files/models.py create mode 100644 index/files/tests.py create mode 100644 index/files/views.py diff --git a/index/books/models.py b/index/books/models.py index 18040af..c49af4e 100755 --- a/index/books/models.py +++ b/index/books/models.py @@ -28,6 +28,9 @@ class Book(models.Model): def __unicode__(self): return self.title + def get_title(self): + return self.title + class ChapterEntry(models.Model): title = models.TextField() synopsis = models.TextField(blank=True) diff --git a/index/files/__init__.py b/index/files/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/index/files/models.py b/index/files/models.py new file mode 100644 index 0000000..6eb5902 --- /dev/null +++ b/index/files/models.py @@ -0,0 +1,8 @@ +from django.db import models + +class File(models.Model): + + + class Meta: + abstract = True +# Create your models here. diff --git a/index/files/tests.py b/index/files/tests.py new file mode 100644 index 0000000..2247054 --- /dev/null +++ b/index/files/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these 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.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/index/files/views.py b/index/files/views.py new file mode 100644 index 0000000..60f00ef --- /dev/null +++ b/index/files/views.py @@ -0,0 +1 @@ +# Create your views here.