Example #1
0
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
Example #2
0
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
Example #3
0
 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',
         }
Example #4
0
 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',
         }
Example #5
0
 def options(self):
     return [(g["id"], g["key"][1]) for g in CommCareCaseGroup.get_all(self.domain, include_docs=False)]
Example #6
0
 def options(self):
     return [
         (g["id"], g["key"][1])
         for g in CommCareCaseGroup.get_all(self.domain, include_docs=False)
     ]