Esempio n. 1
0
 def program_layer_save_layer_text(self,  visiting_group_id='', booking_day_id='',  bucket_time='', layer_text_id='',  text='',  title=''):
     is_new = (layer_text_id=='')
     
     if is_new:
         id = genUID(type='program_layer_text')
         
         #...if slot_id is none, we need to figure out slot_id of bucket_time OR we simply save bucket_time
         
         layer_text = dict(type='program_layer_text',  subtype='layer_text',  state=0,  booking_day_id=booking_day_id, bucket_time=bucket_time )
         #...populate sheets and computed sheets?
         
         layer_text['text'] = text
         layer_text['title'] = title
         layer_text['visiting_group_id'] = visiting_group_id
         holly_couch[id] = layer_text
     else:
         layer_text = common_couch.getLayerText(holly_couch, layer_text_id)
         
         
         layer_text['text'] = text
         layer_text['title'] = title
         holly_couch[layer_text['_id']] = layer_text
         # TODO call it bucket text or layer text ?
         
     visiting_group =  common_couch.getVisitingGroup(holly_couch,  visiting_group_id)
     layer_text['layer_title']=visiting_group['name']
     layer_text['layer_colour'] = "#fff"
     return dict(layer_text=layer_text) 
Esempio n. 2
0
 def program_layer_get_layer_text(self,  layer_text_id=''):
     layer_text = common_couch.getLayerText(holly_couch, layer_text_id)
     visiting_group =  common_couch.getVisitingGroup(holly_couch,  layer_text['visiting_group_id'])
     
     layer_text['layer_title']=visiting_group['name']
     layer_text['layer_colour'] = "#fff"
     layer_text['layer_text_id'] = layer_text['_id']
     return dict(layer_text=layer_text)
Esempio n. 3
0
 def program_layer_edit_text(self,  visiting_group_id, layer_text_id=''):
     is_new = (layer_text_id=='')
     
     if is_new:
         layer_text = DataContainer(text='',  title='', program_layer_text_id='',  state=0)
     else:
         layer_text = common_couch.getLayerText(holly_couch, layer_text_id)
         
     return dict(layer_text=layer_text)
Esempio n. 4
0
 def program_layer_delete_layer_text(self, layer_text_id):
     layer_text = common_couch.getLayerText(holly_couch, layer_text_id)
     layer_text['state'] = -100
     holly_couch[layer_text_id] = layer_text
     return dict()