-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtesis_bd.py
44 lines (30 loc) · 1.16 KB
/
tesis_bd.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
36
37
38
39
40
"""
AppEngine Database Schema
"""
__author__ = 'jpastor'
from google.appengine.ext import ndb
RECORD_FIELDS = ["words", "figures",
"equations", "equations_inline",
"cites", "pages", "date"]
RECORD_NAMES = ["Words", "Figures",
"Equations", "Equations inline",
"Cites", "Pages", "Date"]
record_field_to_name = {}
for i, _ in enumerate(RECORD_FIELDS):
record_field_to_name[RECORD_FIELDS[i]] = RECORD_NAMES[i]
class Doctor(ndb.Model):
name = ndb.StringProperty()
email = ndb.StringProperty(default="")
token = ndb.StringProperty(default="")
class Record(ndb.Model):
doctor = ndb.KeyProperty(kind=Doctor)
words = ndb.IntegerProperty(indexed=False, default=0)
figures = ndb.IntegerProperty(default=0)
equations = ndb.IntegerProperty(indexed=False, default=0)
equations_inline = ndb.IntegerProperty(indexed=False, default=0)
cites = ndb.IntegerProperty(default=0)
pages = ndb.IntegerProperty(default=0)
date = ndb.DateTimeProperty(auto_now_add=True)
class LastRecord(ndb.Model):
doctor = ndb.KeyProperty(kind=Doctor)
record = ndb.KeyProperty(kind=Record)