# -*- coding: utf-8 -*- from django.db import models from seminar.models import Organizator class Seznam(models.Model): pass CHOICES_OBTIZNOST = ( (1, 'Lehká'), (2, 'Střední'), (3, 'Těžká'), ) CHOICES_BODY = ( (-1, '-1'), (0, '0'), (1, '1'), ) class Prednaska(models.Model): nazev = models.CharField('Název', max_length = 300) org = models.ForeignKey(Organizator) anotace = models.TextField('Anotace') obtiznost = models.IntegerField('Obtížnost', choices=CHOICES_OBTIZNOST) obor = models.CharField('Obor', max_length = 5) klicova = models.CharField('Klíčová slova', max_length = 200, null = True, blank = True) seznam = models.ForeignKey(Seznam, blank = True, default = None) class Hlasovani(models.Model): prednaska = models.ForeignKey(Prednaska) body = models.IntegerField('Body', default = 0, choices = CHOICES_BODY) ucastnik = models.CharField('Účastník', max_length = 100)