def api_url_patterns(): # todo: these have to come first to short-circuit tastypie's matching yield url(r'v0.5/odata/Cases/$', ODataServiceView.as_view(), name='odata_service') yield url(r'v0.5/odata/Cases/\$metadata$', ODataMetadataView.as_view(), name='odata_meta') for version, resources in API_LIST: api = CommCareHqApi(api_name='v%d.%d' % version) for R in resources: api.register(R()) yield url(r'^', include(api.urls)) # HACK: fix circular import here, to fix later try: from pact.api import PactAPI except ImportError: pass # maybe pact isn't installed for view_class in DomainAPI.__subclasses__(): yield url(r'^custom/%s/v%s/$' % (view_class.api_name(), view_class.api_version()), view_class.as_view(), name="%s_%s" % (view_class.api_name(), view_class.api_version())) yield url(r'^case/attachment/(?P<case_id>[\w\-:]+)/(?P<attachment_id>.*)$', CaseAttachmentAPI.as_view(), name="api_case_attachment") yield url(r'^form/attachment/(?P<form_id>[\w\-:]+)/(?P<attachment_id>.*)$', FormAttachmentAPI.as_view(), name="api_form_attachment")
def api_url_patterns(): for version, resources in API_LIST: api = CommCareHqApi(api_name="v%d.%d" % version) for R in resources: api.register(R()) for R in COMMTRACK_RESOURCES: api.register(R()) yield (r"^", include(api.urls)) yield url(r"^v0.1/xform_es/$", XFormES.as_domain_specific_view()) # HACK: fix circular import here, to fix later try: from pact.api import PactAPI except ImportError: pass # maybe pact isn't installed for view_class in DomainAPI.__subclasses__(): yield url( r"^custom/%s/v%s/$" % (view_class.api_name(), view_class.api_version()), view_class.as_view(), name="%s_%s" % (view_class.api_name(), view_class.api_version()), ) yield url( r"^case/attachment/(?P<case_id>[\w\-]+)/(?P<attachment_id>.*)$", CaseAttachmentAPI.as_view(), name="api_case_attachment", ) yield url(r"^redis_assets/$", RedisAssetsAPI.as_view())
def api_url_patterns(): for version, resources in API_LIST: api = CommCareHqApi(api_name='v%d.%d' % version) for R in resources: api.register(R()) yield url(r'^', include(api.urls)) # HACK: fix circular import here, to fix later try: from pact.api import PactAPI except ImportError: pass # maybe pact isn't installed for view_class in DomainAPI.__subclasses__(): yield url(r'^custom/%s/v%s/$' % (view_class.api_name(), view_class.api_version()), view_class.as_view(), name="%s_%s" % (view_class.api_name(), view_class.api_version())) yield url(r'^case/attachment/(?P<case_id>[\w\-]+)/(?P<attachment_id>.*)$', CaseAttachmentAPI.as_view(), name="api_case_attachment") yield url(r'^form/attachment/(?P<form_id>[\w\-]+)/(?P<attachment_id>.*)$', FormAttachmentAPI.as_view(), name="api_form_attachment")
def api_url_patterns(): for version, resources in API_LIST: api = CommCareHqApi(api_name='v%d.%d' % version) for R in resources: api.register(R()) for R in COMMTRACK_RESOURCES: api.register(R()) yield (r'^', include(api.urls)) yield url(r'^v0.1/xform_es/$', XFormES.as_domain_specific_view()) # HACK: fix circular import here, to fix later try: from pact.api import PactAPI except ImportError: pass # maybe pact isn't installed for view_class in DomainAPI.__subclasses__(): yield url(r'^custom/%s/v%s/$' % (view_class.api_name(), view_class.api_version()), view_class.as_view(), name="%s_%s" % (view_class.api_name(), view_class.api_version()))
def api_url_patterns(): for version, resources in API_LIST: api = CommCareHqApi(api_name='v%d.%d' % version) for R in resources: api.register(R()) for R in COMMTRACK_RESOURCES: api.register(R()) yield (r'^', include(api.urls)) yield url(r'^v0.1/xform_es/$', XFormES.as_domain_specific_view()) # HACK: fix circular import here, to fix later try: from pact.api import PactAPI except ImportError: pass # maybe pact isn't installed for view_class in DomainAPI.__subclasses__(): yield url(r'^custom/%s/v%s/$' % (view_class.api_name(), view_class.api_version()), view_class.as_view(), name="%s_%s" % (view_class.api_name(), view_class.api_version())) yield url(r'^case/attachment/(?P<case_id>[\w\-]+)/(?P<attachment_id>.*)$', CaseAttachmentAPI.as_view(), name="api_case_attachment") yield url(r'^redis_assets/$', RedisAssetsAPI.as_view())