added files/

This commit is contained in:
sanj 2010-06-09 20:00:34 +05:30
parent a8714599aa
commit 1011b48877
5 changed files with 35 additions and 0 deletions

View File

@ -28,6 +28,9 @@ class Book(models.Model):
def __unicode__(self): def __unicode__(self):
return self.title return self.title
def get_title(self):
return self.title
class ChapterEntry(models.Model): class ChapterEntry(models.Model):
title = models.TextField() title = models.TextField()
synopsis = models.TextField(blank=True) synopsis = models.TextField(blank=True)

0
index/files/__init__.py Normal file
View File

8
index/files/models.py Normal file
View File

@ -0,0 +1,8 @@
from django.db import models
class File(models.Model):
class Meta:
abstract = True
# Create your models here.

23
index/files/tests.py Normal file
View File

@ -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
"""}

1
index/files/views.py Normal file
View File

@ -0,0 +1 @@
# Create your views here.