From f41354006f6786de5a85458c587980473cfd1b9c Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 13 Dec 2013 09:05:31 +0000 Subject: [PATCH] Add wq.db --- api-guide/routers.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api-guide/routers.html b/api-guide/routers.html index 2ff486720..c4477541c 100644 --- a/api-guide/routers.html +++ b/api-guide/routers.html @@ -178,6 +178,7 @@
  • Advanced custom routers
  • Third Party Packages
  • DRF Nested Routers
  • +
  • wq.db

  • @@ -334,9 +335,16 @@ class ReadOnlyRouter(SimpleRouter):

    If you want to provide totally custom behavior, you can override BaseRouter and override the get_urls(self) method. The method should inspect the registered viewsets and return a list of URL patterns. The registered prefix, viewset and basename tuples may be inspected by accessing the self.registry attribute.

    You may also want to override the get_default_base_name(self, viewset) method, or else always explicitly set the base_name argument when registering your viewsets with the router.

    Third Party Packages

    -

    The following third party packages provide router implementations that extend the default functionality provided by REST framework.

    +

    The following third party packages are also available.

    DRF Nested Routers

    The drf-nested-routers package provides routers and relationship fields for working with nested resources.

    +

    wq.db

    +

    The wq.db package provides an advanced Router class (and singleton instance) that extends DefaultRouter with a register_model() API. Much like Django's admin.site.register, the only required argument to app.router.register_model is a model class. Reasonable defaults for a url prefix and viewset will be inferred from the model and global configuration.

    +
    from wq.db.rest import app
    +from myapp.models import MyModel
    +
    +app.router.register_model(MyModel)
    +