-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.py
More file actions
33 lines (24 loc) · 795 Bytes
/
model.py
File metadata and controls
33 lines (24 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from peewee import Model, CharField, IntegerField
import os
#from playhouse.sqlite_ext import SqliteExtDatabase
#db = SqliteExtDatabase('my_database.db')
# heroku run -s free -- python setup.py
from playhouse.db_url import connect
db = connect(os.environ.get('DATABASE_URL', 'sqlite:///my_database.db'))
class SavedTotal(Model):
code = CharField(max_length=255, unique=True)
value = IntegerField(max_length=255)
class Meta:
database = db
# class Context(BaseModel):
# name = CharField(max_length=255)
#
#
# class ContextTask(BaseModel):
# context_id = IntegerField() # foreign key into context
# task_id = IntegerField() # foreign key into task
#
# class Meta:
# primary_key = CompositeKey(
# 'context_id', 'task_id'
# )