All pastes #633296 Raw Edit

Stuff

public python v1 · immutable
#633296 ·published 2007-07-25 16:25 UTC
rendered paste body
from django.db import models# Create your models here.GENRE_CHOICES = (    ('Comedy', 'Comedy'),    ('Theatre', 'Theatre'),    ('Music', 'Music'),    ('Musicals and Operas', 'Musicals & Operas'),    ('Events', 'Events'),    ("Children's Shows", "Children's Shows"),    ("Dance and Physical Theatre", "Dance & Physical Theatre"),    ('Exhibition', 'Exhibition'),)class Venue(models.Model):    name = models.CharField(maxlength=200)    postcode = models.CharField(maxlength=8)        def __str__(self):        return self.name	    class Admin:        search_fields = ['name']        list_display = ['name']    class Meta:        ordering = ['name']class Performer(models.Model):    name = models.CharField(maxlength=255)        def __str__(self):        return self.name	    class Admin:        search_fields = ['name']    class Meta:        ordering = ['name']    	class Show(models.Model):    name = models.CharField(maxlength=200)    category = models.CharField(maxlength=40, choices=GENRE_CHOICES)    venue = models.ForeignKey(Venue, verbose_name="Venue")    performer = models.ForeignKey(Performer, verbose_name="Performer")    description = models.TextField()    warning = models.CharField("Warning",blank=True,maxlength=70)    agerange = models.CharField("Age range",blank=True,maxlength=70)    url = models.URLField(blank=True)        def __str__(self):        return self.name	    class Admin:        search_fields = ['name']        list_filter = ['category']        list_display = ['name','category']    class Meta:	    ordering = ['name']class Performance(models.Model):    show = models.ForeignKey(Show, edit_inline=models.TABULAR, num_in_admin=5)    start = models.DateTimeField()    end = models.DateTimeField()    price = models.FloatField(max_digits=5, decimal_places=2)    twofer = models.BooleanField()    preview = models.BooleanField()    class Meta:	    ordering = ['start']