-
Notifications
You must be signed in to change notification settings - Fork 1
/
model.py
35 lines (25 loc) · 877 Bytes
/
model.py
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
34
35
# -*- coding: utf-8 -*-
__author__ = 'ufian'
import mongoengine as me
class Product(me.Document):
meta = {'collection': 'products'}
user_id = me.IntField(required=True)
calories = me.IntField(required=True)
name = me.StringField(required=True)
class Eating(me.Document):
meta = {'collection': 'eating'}
user_id = me.IntField(required=True)
product_id = me.IntField()
weight = me.IntField()
calories = me.IntField()
date = me.DateTimeField(required=True)
class UserConfig(me.Document):
meta = {'collection': 'user_configs'}
user_id = me.IntField(required=True)
params = me.DictField()
context = me.DictField()
data = me.DictField()
class GlobalConfig(me.Document):
meta = {'collection': 'global_config'}
param = me.StringField(required=True)
value = me.StringField(required=True)