def update(command): ids = cms.update(command, base_class, field_shorts, field_names, field_modifiers) deletings = cms.get_parameter_cmd(command, upd_field_shorts[1]) appendings = cms.get_parameter_cmd(command, upd_field_shorts[0]) if deletings != None: for id in ids: delete_date_states(id, upd_field_modifiers[1](" ".join(deletings ) ) ) if appendings != None: for id in ids: append_date_states(id, upd_field_modifiers[0](" ".join(appendings ) ) )
def create(command): client = cms.create(command, base_class, field_shorts, field_names, field_modifiers, session) phone = " ".join(cms.get_parameter_cmd(command, "-ph")) print(phone) cmd = ("cc -pt client -pi "+str(client._id)[2:]+" -t phone -c "+phone).split(' '); print(cmd) try: contacts_.create(cmd) except: print("Error adding client! Message: %s. Please, check your input." % sys.exc_info()[1]) client.delete()
def create(command): worker = cms.create(command, base_class, field_shorts, field_names, field_modifiers) phone = " ".join(cms.get_parameter_cmd(command, "-ph")) #print(phone) cmd = ("cc -ps worker -pi " + str(worker.id) + " -t phone -c " + phone).split(' ') #print(cmd) try: contacts_.create(cmd) except: print("Error adding worker! Message: %s. Please, check your input." % sys.exc_info()[1]) with db_session: worker.delete()
def create(command): new_ds = cms.create(command, base_class, field_shorts, field_names, field_modifiers) if cms.get_parameter_cmd(command, extra_field_shorts[0]) != None: set_date_states(new_ds.id, extra_field_modifiers[0](" ".join(cms.get_parameter_cmd(command, extra_field_shorts[0]) ) ) )
def create(command): new_request = cms.create(command, base_class, field_shorts, field_names, field_modifiers) set_holdings(new_request.id, extra_field_modifiers[0](" ".join(cms.get_parameter_cmd(command, extra_field_shorts[0]) ) ) )
def create(command): new_qualification = cms.create(command, base_class, field_shorts, field_names, field_modifiers) set_rendered_services( new_qualification.id, extra_field_modifiers[0](" ".join( cms.get_parameter_cmd(command, extra_field_shorts[0]))))