You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Resources can be included directly in a urls conf without specifying an api site. This results in the Resource being registered with the global_site api. Resource endpoints should be able to do the same.
There are a couple ways this could take shape::
myresource = ModelResource(resource_adaptor=MyModel)
#this probably already works or requires the least changes
urlpatterns += ('', myresource.endpoints['create'].get_url_object())
#this gives greater url control which is more like what we want
urlpatterns += ('', url('^add/$', myresource.endpoints['create'].get_standalone_view()))
The latter requires that we detect the url info after its inclusion in urls which is different from how it is done now where the resource itself determines the url info. Since the endpoint.as_view emits a callable with an endpoint attribute matching the originator we can dig up the endpoint after the urlconf is generated. Unfortunately there is no signal we can hook into that says the root urlconf is completed for us so we may end up monkey patching get_urconf to add such a signal.
The other foreseeable change is that each standalone endpoint may have different namespaces. Currently the reversing is done at the root endpoint and the namespace is added there. Handling reversing at the endpoint level may conflict with our ability to proxy APIs from one client to another. Perhaps adding a reverse_endpoint where the endpoint itself is passed instead of it's urlname would resolve this.
The text was updated successfully, but these errors were encountered:
Currently Resources can be included directly in a urls conf without specifying an api site. This results in the Resource being registered with the global_site api. Resource endpoints should be able to do the same.
There are a couple ways this could take shape::
The latter requires that we detect the url info after its inclusion in urls which is different from how it is done now where the resource itself determines the url info. Since the endpoint.as_view emits a callable with an endpoint attribute matching the originator we can dig up the endpoint after the urlconf is generated. Unfortunately there is no signal we can hook into that says the root urlconf is completed for us so we may end up monkey patching get_urconf to add such a signal.
The other foreseeable change is that each standalone endpoint may have different namespaces. Currently the reversing is done at the root endpoint and the namespace is added there. Handling reversing at the endpoint level may conflict with our ability to proxy APIs from one client to another. Perhaps adding a reverse_endpoint where the endpoint itself is passed instead of it's urlname would resolve this.
The text was updated successfully, but these errors were encountered: