コード例 #1
0
ファイル: v0_5.py プロジェクト: zbidi/commcare-hq
 class Meta:
     resource_name = 'location'
     detail_uri_name = 'location_id'
     queryset = SQLLocation.objects.filter(is_archived=False).all()
     authentication = DomainAdminAuthentication()
     allowed_methods = ['get']
     fields = [
         'id',
         'name',
         'domain',
         'location_id',
         'site_code',
         'external_id',
         'created_at',
         'last_modified',
         'latitude',
         'longitude',
     ]
     filtering = {
         'domain': ['exact'],
         'site_code': ['exact'],
         'external_id': ['exact'],
         'created_at': ALL,
         'last_modified': ALL,
         'latitude': ALL,
         'longitude': ALL,
     }
コード例 #2
0
ファイル: v0_5.py プロジェクト: zbidi/commcare-hq
 class Meta:
     resource_name = 'location_type'
     queryset = LocationType.objects.all()
     authentication = DomainAdminAuthentication()
     fields = [
         'id',
         'domain',
         'name',
         'code',
         'parent_type',
         'administrative',
         'shares_cases',
         'view_descendants',
     ]
     filtering = {
         "domain": ('exact', ),
     }
コード例 #3
0
 class Meta(CustomResourceMeta):
     authentication = DomainAdminAuthentication()
     object_class = Repeater
     resource_name = 'data-forwarding'
     detail_allowed_methods = ['get', 'put', 'delete']
     list_allowed_methods = ['get', 'post']
コード例 #4
0
ファイル: v0_1.py プロジェクト: twymer/commcare-hq
 class Meta(CustomResourceMeta):
     authentication = DomainAdminAuthentication()
     resource_name = 'product'
     limit = 0