2010-10-18 13:34:47 +00:00
|
|
|
from django.db import models
|
|
|
|
|
2011-10-13 21:34:56 +00:00
|
|
|
|
2010-10-18 13:34:47 +00:00
|
|
|
class Artist(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
ordering = ['name']
|
2011-01-03 13:15:58 +00:00
|
|
|
verbose_name = 'professional artist'
|
|
|
|
verbose_name_plural = 'professional artists'
|
2010-10-18 13:34:47 +00:00
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
return self.name
|
|
|
|
|
|
|
|
@models.permalink
|
|
|
|
def get_absolute_url(self):
|
|
|
|
return ('artist_detail', (), {'pk': self.id})
|
|
|
|
|
|
|
|
class Author(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
slug = models.SlugField()
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
ordering = ['name']
|
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
return self.name
|
|
|
|
|
|
|
|
class Book(models.Model):
|
|
|
|
name = models.CharField(max_length=300)
|
|
|
|
slug = models.SlugField()
|
|
|
|
pages = models.IntegerField()
|
|
|
|
authors = models.ManyToManyField(Author)
|
|
|
|
pubdate = models.DateField()
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
ordering = ['-pubdate']
|
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
return self.name
|
|
|
|
|
|
|
|
class Page(models.Model):
|
|
|
|
content = models.TextField()
|
|
|
|
template = models.CharField(max_length=300)
|
2012-04-30 18:41:38 +00:00
|
|
|
|
|
|
|
class BookSigning(models.Model):
|
|
|
|
event_date = models.DateTimeField()
|