2323 RE_NS_SLASH_ID , "Only alphanumeric, underscore, hyphen, period, in namespace/idname format allowed."
2424)
2525
26- # assign accessible model for persist collection
27- def get_arenaobjects_collection ():
28- from .persist_db import get_persist_db
29- return get_persist_db ()['arenaobjects' ]
30-
31- # arenaobjects schema reference:
32- # https://github.com/arenaxr/arena-persist/blob/master/server.js#L28-L42
33- # object_id: {type: String, required: true, index: true},
34- # type: {type: String, required: true, index: true},
35- # attributes: {type: Object, required: true, default: {}},
36- # expireAt: {type: Date, expires: 0},
37- # realm: {type: String, required: true, index: true},
38- # namespace: {type: String, required: true, index: true, default: 'public'},
39- # sceneId: {type: String, required: true, index: true},
40- # private: {type: Boolean},
41- # program_id: {type: String},
42-
43-
4426class NamespaceDefault :
4527 def __init__ (self , name = "" ):
4628 self .name = name
@@ -58,7 +40,7 @@ class Namespace(models.Model):
5840
5941 def save (self , * args , ** kwargs ):
6042 self .full_clean () # performs regular validation then clean()
61- super (Namespace , self ).save (* args , ** kwargs )
43+ super ().save (* args , ** kwargs )
6244
6345 def clean (self ):
6446 if self .name == "" :
@@ -103,7 +85,7 @@ class Scene(models.Model):
10385
10486 def save (self , * args , ** kwargs ):
10587 self .full_clean () # performs regular validation then clean()
106- super (Scene , self ).save (* args , ** kwargs )
88+ super ().save (* args , ** kwargs )
10789
10890 def clean (self ):
10991 if self .name == "" :
@@ -129,11 +111,11 @@ def sceneid(self):
129111 @property
130112 def is_default (self ):
131113 return (
132- self .public_read is SCENE_PUBLIC_READ_DEF
133- and self .public_write is SCENE_PUBLIC_WRITE_DEF
134- and self .anonymous_users is SCENE_ANON_USERS_DEF
135- and self .video_conference is SCENE_VIDEO_CONF_DEF
136- and self .users is SCENE_USERS_DEF
114+ self .public_read == SCENE_PUBLIC_READ_DEF
115+ and self .public_write == SCENE_PUBLIC_WRITE_DEF
116+ and self .anonymous_users == SCENE_ANON_USERS_DEF
117+ and self .video_conference == SCENE_VIDEO_CONF_DEF
118+ and self .users == SCENE_USERS_DEF
137119 and self .editors .count () == 0
138120 and self .viewers .count () == 0
139121 )
@@ -148,7 +130,7 @@ class Device(models.Model):
148130
149131 def save (self , * args , ** kwargs ):
150132 self .full_clean () # performs regular validation then clean()
151- super (Device , self ).save (* args , ** kwargs )
133+ super ().save (* args , ** kwargs )
152134
153135 def clean (self ):
154136 if self .name == "" :
0 commit comments