File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ class Pycamp(BaseModel):
5757 vote_authorized = pw .BooleanField (default = False , null = True )
5858 project_load_authorized = pw .BooleanField (default = False , null = True )
5959 active = pw .BooleanField (default = False , null = True )
60+ wizard_slot_duration = pw .IntegerField (default = 60 , null = False ) # In minutes
6061
6162 def __str__ (self ):
6263 rv_str = 'Pycamp:\n '
@@ -65,6 +66,17 @@ def __str__(self):
6566 rv_str += f'{ attr } : { getattr (self , attr )} \n '
6667 return rv_str
6768
69+ def set_as_only_active (self ):
70+ active = Pycamp .select ().where (Pycamp .active )
71+ for p in active :
72+ p .active = False
73+ Pycamp .bulk_update (active , fields = [Pycamp .active ])
74+ self .active = True
75+ self .save ()
76+
77+ def get_wizards (self ):
78+ return Pycampista .select ().where (Pycampista .wizard == 1 )
79+
6880
6981class PycampistaAtPycamp (BaseModel ):
7082 '''
You can’t perform that action at this time.
0 commit comments