Anonymous Anonymous - 2 months ago
116 0

das

Python

classes

from __future__ import unicode_literals

from django.db import models

# Create your models here.


class Band (models.Model):
    band_name = models.Charfield(max_length=30)
    prior_concerts = models.Concert[0]
    genre = models.Charfield(max_length=20)
    albums = models.Album[0]
    booking_price = models.Integerfield(max_length=10)
    streaming_numbers = models.Intgerfield(max_length=12)
    manager = models.Person


class Album(models.Model):
    name = models.Charfield(max_length=30)
    sales_numbers = models.Intgerfield(max_length=10)


class Concert (models.Model):
    STATUS_CHOICES = (
        'booked',
        'contacted',
        'paid',
    )
    band = models.Band
    scene = models.Scene
    personnel = models.Person[0]
    attendance = models.Intgerfield(max_length=4)
    ticket_price = models.Intgerfield(max_length=4)
    status = models.Charfield(
        choices=STATUS_CHOICES,
        default='contacted'
    )


class Scene(models.Model):
    SCENE_CHOICES = (
        'storsalen',
        'klubben',
        'knaus',
    )
    scene_name = models.Charfield(
        choices=SCENE_CHOICES,
        default='storsalen',
    )
    number_of_seats=models.Intgerfield(max_length=3)
    handicap_accessible=models.Booleanfield


class Person(models.Model):
    first_name = models.Charfield(max_length=20)
    last_name = models.Charfield(max_length=20)
    telephone_number = models.Intgerfield(max_length=8)
    email = models.Charfield(max_length=50)
    ROLE_CHOICES = (
        'manager',
        'organizer',
        'rigger',
        'chief organizer'
        'volunteer'
    )
    role = models.Charfield(
        choices=ROLE_CHOICES,
        default='volunteer',
    )
Comments