Ejemplo n.º 1
0
class Movie(Table, db=DB):
    name = Varchar(length=300)
    rating = Real()
    duration = Integer()
    director = ForeignKey(references=Director)
    won_oscar = Boolean()
    description = Text()
    release_date = Timestamp()
    box_office = Numeric(digits=(5, 1))
Ejemplo n.º 2
0
class Movie(Table):
    name = Varchar(length=300)
    rating = Real(help_text="The rating on IMDB.")
    duration = Interval()
    director = ForeignKey(references=Director)
    oscar_nominations = Integer()
    won_oscar = Boolean()
    description = Text()
    release_date = Timestamp()
    box_office = Numeric(digits=(5, 1), help_text="In millions of US dollars.")
    tags = Array(base_column=Varchar())
Ejemplo n.º 3
0
class Movie(Table):
    class Genre(int, enum.Enum):
        fantasy = 1
        sci_fi = 2
        documentary = 3
        horror = 4
        action = 5
        comedy = 6
        romance = 7
        musical = 8

    name = Varchar(length=300)
    rating = Real(help_text="The rating on IMDB.")
    duration = Interval()
    director = ForeignKey(references=Director)
    oscar_nominations = Integer()
    won_oscar = Boolean()
    description = Text()
    release_date = Timestamp()
    box_office = Numeric(digits=(5, 1), help_text="In millions of US dollars.")
    tags = Array(base_column=Varchar())
    barcode = BigInt(default=0)
    genre = SmallInt(choices=Genre, null=True)
Ejemplo n.º 4
0
class Ticket(Table):
    price = Numeric(digits=(5, 2))
Ejemplo n.º 5
0
class Ticket(Table):
    concert = ForeignKey(Concert)
    price = Numeric(digits=(5, 2))
    purchase_time = Timestamp()
    purchase_time_tz = Timestamptz()
Ejemplo n.º 6
0
 class Movie(Table):
     box_office = Numeric()
Ejemplo n.º 7
0
 class Movie(Table):
     box_office = Numeric(digits=(5, 1))
Ejemplo n.º 8
0
 class Movie(Table):
     box_office = Numeric(digits=(5, 1), help_text=help_text)
Ejemplo n.º 9
0
Archivo: run.py Proyecto: zkan/piccolo
class Ticket(Table):
    concert = ForeignKey(Concert)
    price = Numeric(digits=(5, 2))