Ejemplo n.º 1
0
class City(Model):
    id = Property(str, name='geonameid', primary_key=True)

    name = Property(str)

    country = Property(str)
    subcountry = Property(str)
Ejemplo n.º 2
0
class Album(Model):
    class Options:
        slots = True

    id = Property(int, primary_key=True)
    artist = Property(Artist)

    title = Property(str)
Ejemplo n.º 3
0
class User(Model):
    id = Property(int, primary_key=True)

    username = Property(str)
    password = Property(str)

    created_at = Property(datetime, default=lambda: datetime.now())
    updated_at = Property(datetime, default=lambda: datetime.now())
Ejemplo n.º 4
0
class Album(Model):
    id = Property(int, primary_key=True)
    artist = Property(Artist)

    title = Property(str)
Ejemplo n.º 5
0
class Track(Model):
    id = Property(int, primary_key=True)
    artist = Property(Artist)
    album = Property(Album)

    title = Property(str)
Ejemplo n.º 6
0
class Artist(Model):
    id = Property(int, primary_key=True)

    title = Property(str)