def get_sample_list(domain): #Circular import from casexml.apps.case.models import CommCareCaseGroup sample_list = [] for sample in CommCareCaseGroup.get_all(domain): sample_list.append({"code" : sample._id, "name" : sample.name}) return sample_list
def paginated_list(self): for group in CommCareCaseGroup.get_all(self.domain, limit=self.limit, skip=self.skip): item_data = self._get_item_data(group) item_data['updateForm'] = self.get_update_form_response( self.get_update_form(initial_data={ 'item_id': group._id, 'name': group.name, })) yield { 'itemData': item_data, 'template': 'existing-group-template', }
def paginated_list(self): for group in CommCareCaseGroup.get_all( self.domain, limit=self.limit, skip=self.skip ): item_data = self._get_item_data(group) item_data['updateForm'] = self.get_update_form_response( self.get_update_form(initial_data={ 'item_id': group._id, 'name': group.name, }) ) yield { 'itemData': item_data, 'template': 'existing-group-template', }
def options(self): return [(g["id"], g["key"][1]) for g in CommCareCaseGroup.get_all(self.domain, include_docs=False)]
def options(self): return [ (g["id"], g["key"][1]) for g in CommCareCaseGroup.get_all(self.domain, include_docs=False) ]