def get_keys_for_docrule(self, docrule_id, mdts = None): pkeys = {} mdt_manager = MetaDataTemplateManager() mdt_manager.docrule_id = docrule_id # valid Mdt id... if mdt_manager.mdt_read_call_valid(): if not mdts: mdts = mdt_manager.get_mdts_for_docrule(docrule_id) pkeys = self.get_parallel_keys_for_mdts(mdts) return pkeys
def get_keys_for_docrule(self, docrule_id, mdts = None): pkeys = {} mdt_manager = MetaDataTemplateManager() mdt_manager.docrule_id = docrule_id # valid Mdt id... if mdt_manager.mdt_read_call_valid(): if not mdts: mdts = mdt_manager.get_mdts_for_docrule(docrule_id) pkeys = self.get_parallel_keys_for_mdts(mdts) return pkeys
def get_mdts_for_docrule(docrule_id): """ Generates list of form fields for document. Uses MDT's for docrule to list form fields. """ log.debug("Getting MDT's from CouchDB") if docrule_id.__class__.__name__ == 'int': docrule_id = str(docrule_id) mdt_manager = MetaDataTemplateManager() mdt_manager.docrule_id = docrule_id mdts_dict = mdt_manager.get_mdts_for_docrule(docrule_id) # there is at least 1 MDT exists if not mdts_dict == 'error': log.debug("Got MDT's: %s" % mdts_dict) else: log.debug("No MDT's found") return mdts_dict
def get_mdts_for_docrule(docrule_id): """ Generates list of form fields for document. Uses MDT's for docrule to list form fields. """ log.debug("Getting MDT's from CouchDB") if docrule_id.__class__.__name__ == 'int': docrule_id = str(docrule_id) mdt_manager = MetaDataTemplateManager() mdt_manager.docrule_id = docrule_id mdts_dict = mdt_manager.get_mdts_for_docrule(docrule_id) # there is at least 1 MDT exists if not mdts_dict=='error': log.debug("Got MDT's: %s" % mdts_dict) else: log.debug("No MDT's found") return mdts_dict