Is it possible to use generic url settings to implement the django rest interface for all models in django?
So instead of per model configuration:
class BlogResource(ModelResource):
model = Blog
urlpatterns = patterns('',
url(r'^Blog/$', ListOrCreateModelView.as_view(resource=BlogResource)),
url(r'^Blog/(?P<pk>[^/]+)/$', InstanceModelView.as_view(resource=BlogResource)),
)
A more generic type of loading:
urlpatterns = patterns('',
url(r'^(?P<model>\w+)/$', GenericView.render_model_list()),
url(r'^(?P<model>\w+)/(?P<pk>[^/]+)/$', GenericView.render_model()),
)
With something that allows the system to generate the model and render it to the rest interface.
in more general way the solution would look like this (sorry – i wrote it by hand), but you still need to import these models and form the model tuple by hand.