2007-09-17 14:48:33 +00:00
|
|
|
"""
|
|
|
|
Regression tests for Django built-in views
|
|
|
|
"""
|
|
|
|
|
|
|
|
from django.db import models
|
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
class Author(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
return self.name
|
|
|
|
|
|
|
|
def get_absolute_url(self):
|
|
|
|
return '/views/authors/%s/' % self.id
|
|
|
|
|
|
|
|
|
|
|
|
class Article(models.Model):
|
|
|
|
title = models.CharField(max_length=100)
|
2007-09-19 13:26:56 +00:00
|
|
|
slug = models.SlugField()
|
2007-09-17 14:48:33 +00:00
|
|
|
author = models.ForeignKey(Author)
|
2007-09-19 13:26:56 +00:00
|
|
|
date_created = models.DateTimeField()
|
|
|
|
|
2007-09-17 14:48:33 +00:00
|
|
|
def __unicode__(self):
|
|
|
|
return self.title
|
|
|
|
|