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
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
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", )
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", )
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", )
class Detail(db.Model): game_id = CharField() time = DateField() wagered = FloatField() result = FloatField() summary_id = ForeignKeyField(Summary) identifier = CharField()
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", )
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", )
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)