Esempio n. 1
0
class ReservationState(db.Model):

    value = CharField()
    date_created = DateField(default=now)
    date_updated = DateField(default=now)

    identifier = BooleanField()

    def __unicode__(self):
        return "%s" % self.value
Esempio n. 2
0
class Tariff(db.Model):

    name = CharField()
    date_created = DateField(default=now)
    date_updated = DateField(default=now)

    period = FloatField()
    cost = FloatField()
    discount = FloatField()

    def __unicode__(self):
        return "%s" % self.name
Esempio n. 3
0
class Company(db.Model):

    name = CharField(unique=True)
    mail = CharField(unique=True)
    address = TextField()
    contacts = TextField()
    date_created = DateField(default=now)
    date_updated = DateField(default=now)

    def __unicode__(self):
        return "%s" % self.name

    class Meta:
        order_by = ("name", )
Esempio n. 4
0
class Reservation(db.Model):

    date_created = DateField(default=now)
    date_updated = DateField(default=now)

    time_start = TimeField()
    time_finish = TimeField()
    reservation_state_id = ForeignKeyField(ReservationState)
    bike_id = ForeignKeyField(Bike)
    person_id = ForeignKeyField(Person)

    def __unicode__(self):
        return "%s : %s" % (self.time_start, self.time_finish)

    class Meta:
        order_by = ("date_updated", )
Esempio n. 5
0
class Bike(db.Model):

    name = CharField()
    date_created = DateField(default=now)
    date_updated = DateField(default=now)

    gender = CharField()
    size = CharField()
    point_id = ForeignKeyField(Point)
    tariff_id = ForeignKeyField(Tariff)

    def __unicode__(self):
        return "%s" % self.name

    class Meta:
        order_by = ("name", )
Esempio n. 6
0
class Detail(db.Model):

    game_id = CharField()
    time = DateField()
    wagered = FloatField()
    result = FloatField()
    summary_id = ForeignKeyField(Summary)
    identifier = CharField()
Esempio n. 7
0
class Point(db.Model):

    name = CharField()
    address = TextField()
    contacts = TextField()
    date_created = DateField(default=now)
    date_updated = DateField(default=now)

    location = CharField(unique=True)
    company_id = ForeignKeyField(Company)
    payment_id = ForeignKeyField(Payment)

    def __unicode__(self):
        return "%s" % self.name

    class Meta:
        order_by = ("name", )
Esempio n. 8
0
class Person(db.Model):

    name = CharField()
    mail = CharField(unique=True)
    address = TextField()
    contacts = TextField()

    date_created = DateField(default=now)
    date_updated = DateField(default=now)

    customer = BooleanField()
    point_keeper = BooleanField()

    def __unicode__(self):
        return "%s" % self.name

    class Meta:
        order_by = ("name", )
Esempio n. 9
0
class Summary(db.Model):

    date = DateField()
    game = CharField()
    min = IntegerField()
    plays = IntegerField()
    wagered = FloatField()
    winnings = FloatField()
    pending = FloatField()
    identifier = CharField()

    def __unicode__(self):
        return "%s: %s" % (self.id, self.date)