-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
110 lines (86 loc) · 3.6 KB
/
models.py
File metadata and controls
110 lines (86 loc) · 3.6 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
"""Data models for the CfP Manager.
The following models are defined in this module:
Conference - a conference for which a CfP is to be managed
Speaker - a (hopeful) speaker
Proposal - a talk proposal for a conference (child of Conference)
Review - a review by a reviewer for a talk proposal (child of Talk)
"""
from google.appengine.ext import ndb
from protorpc import messages
class Conference(ndb.Model):
"""A conference entity represents a specific instance
for which a call for papers is open.
"""
name = ndb.StringProperty(required=True)
subtitle = ndb.StringProperty()
cfpDateFrom = ndb.DateProperty()
cfpDateTo = ndb.DateProperty()
details = ndb.TextProperty()
reviewers = ndb.StringProperty(repeated=True)
secret = ndb.StringProperty()
created = ndb.DateTimeProperty()
modified = ndb.DateTimeProperty()
class ConferenceForm(messages.Message):
"""Inbound form for creating a conference form"""
name = messages.StringField(1, required=True)
subtitle = messages.StringField(2)
id = messages.StringField(3, required=True)
cfpDateFrom = messages.StringField(4)
cfpDateTo = messages.StringField(5)
details = messages.StringField(6)
reviewers = messages.StringField(7, repeated=True)
secret = messages.StringField(8)
class ConferencePublicForm(messages.Message):
"""Outbound form - publicly available info on a conference"""
name = messages.StringField(1, required=True)
subtitle = messages.StringField(2)
id = messages.StringField(3, required=True)
cfpDateFrom = messages.StringField(4)
cfpDateTo = messages.StringField(5)
details = messages.StringField(6)
class ConferencePublicForms(messages.Message):
"""Outbound form for getting all open CfPs for conferences"""
items = messages.MessageField(ConferencePublicForm, 1, repeated=True)
class Speaker(ndb.Model):
"""A (hopeful) speaker at a conference."""
name = ndb.StringProperty(required=True)
surname = ndb.StringProperty(required=True)
email = ndb.StringProperty(required=True)
bio = ndb.TextProperty()
created = ndb.DateTimeProperty()
modified = ndb.DateTimeProperty()
rating = ndb.IntegerProperty()
class SpeakerForm(messages.Message):
"""Inbound form for creating a new speaker record."""
name = messages.StringField(1, required=True)
surname = messages.StringField(2, required=True)
email = messages.StringField(3, required=True)
bio = messages.StringField(4)
class SpeakerKeyForm(messages.Message):
"""Outbound form returned to identify a speaker record."""
key = messages.StringField(1)
email = messages.StringField(2)
class Proposal(ndb.Model):
"""A proposal for a call for papers."""
title = ndb.StringProperty(required=True)
speaker = ndb.KeyProperty(kind=Speaker, required=True)
abstract = ndb.TextProperty()
duration = ndb.IntegerProperty()
comment = ndb.TextProperty()
created = ndb.DateTimeProperty()
modified = ndb.DateTimeProperty()
class ProposalForm(messages.Message):
"""Inbound form for a talk proposal."""
title = messages.StringField(1, required=True)
speaker = messages.StringField(2, required=True)
abstract = messages.StringField(3)
duration = messages.IntegerField(4)
comment = messages.StringField(5)
class ProposalKeyForm(messages.Message):
"""Outbound for returned to identify a proposal."""
key = messages.StringField(1)
title = messages.StringField(2)
class Review(ndb.Model):
"""Single review - id is email of user, ancestor is proposal or speaker."""
comment = ndb.StringProperty()
rating = ndb.IntegerProperty()