Merge branch 'api-conf'
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from peewee import (
|
||||
CompositeKey,
|
||||
SqliteDatabase,
|
||||
Model,
|
||||
CharField,
|
||||
@ -32,6 +33,14 @@ class HamsterActivity(Model):
|
||||
table_name = "activities"
|
||||
|
||||
|
||||
class HamsterTag(Model):
|
||||
name = CharField()
|
||||
|
||||
class Meta:
|
||||
database = db
|
||||
table_name = "tags"
|
||||
|
||||
|
||||
class HamsterFact(Model):
|
||||
activity = ForeignKeyField(HamsterActivity, backref="facts")
|
||||
start_time = DateTimeField()
|
||||
@ -43,15 +52,6 @@ class HamsterFact(Model):
|
||||
table_name = "facts"
|
||||
|
||||
|
||||
class HamsterTag(Model):
|
||||
name = CharField()
|
||||
|
||||
class Meta:
|
||||
database = db
|
||||
table_name = "tags"
|
||||
|
||||
|
||||
|
||||
class HamsterFactTag(Model):
|
||||
fact = ForeignKeyField(HamsterFact, backref="tags")
|
||||
tag = ForeignKeyField(HamsterTag, backref="facts")
|
||||
|
Reference in New Issue
Block a user