-
Notifications
You must be signed in to change notification settings - Fork 13
/
widget.py
32 lines (27 loc) · 913 Bytes
/
widget.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
from mongoengine import *
from mongoengine.django.auth import User
try:
from web.lisa.settings import DBNAME
except ImportError:
from lisa.settings import DBNAME
connect(DBNAME)
class Widget(DynamicDocument):
class Meta:
app_label = "interface"
name = StringField(required=True, help_text="Widget name")
view = StringField(required=True, help_text="View of the plugin")
meta = {
'collection': 'widgets',
'allow_inheritance': False
}
class WidgetUser(DynamicDocument):
class Meta:
app_label = "interface"
workspace = ReferenceField('Workspace', required=True, dbref=False)
coordx = IntField(required=True, help_text="X coord")
coordy = IntField(required=True, help_text="X coord")
user = ReferenceField(User, required=True, dbref=False)
meta = {
'collection': 'widgets_users',
'allow_inheritance': False
}