Skip to content

Commit

Permalink
Merge pull request #2909 from sheppard/update-wq
Browse files Browse the repository at this point in the history
update info about wq.db.rest router
  • Loading branch information
jpadilla committed May 5, 2015
2 parents 859c208 + e9b6b47 commit a7d5e32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/api-guide/routers.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,14 @@ The following third party packages are also available.

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

## wq.db
## ModelRouter (wq.db.rest)

The [wq.db package][wq.db] provides an advanced [Router][wq.db-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.
The [wq.db package][wq.db] provides an advanced [ModelRouter][wq.db-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 `rest.router.register_model` is a model class. Reasonable defaults for a url prefix, serializer, and viewset will be inferred from the model and global configuration.

from wq.db.rest import app
from wq.db import rest
from myapp.models import MyModel

app.router.register_model(MyModel)
rest.router.register_model(MyModel)

## DRF-extensions

Expand All @@ -307,7 +307,7 @@ The [`DRF-extensions` package][drf-extensions] provides [routers][drf-extensions
[route-decorators]: viewsets.md#marking-extra-actions-for-routing
[drf-nested-routers]: https://github.com/alanjds/drf-nested-routers
[wq.db]: http://wq.io/wq.db
[wq.db-router]: http://wq.io/docs/app.py
[wq.db-router]: http://wq.io/docs/router
[drf-extensions]: http://chibisov.github.io/drf-extensions/docs/
[drf-extensions-routers]: http://chibisov.github.io/drf-extensions/docs/#routers
[drf-extensions-nested-viewsets]: http://chibisov.github.io/drf-extensions/docs/#nested-routes
Expand Down

0 comments on commit a7d5e32

Please sign in to comment.