Skip to content

Commit e9b6b47

Browse files
committed
update info about wq.db.rest router
1 parent 859c208 commit e9b6b47

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/api-guide/routers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,14 @@ The following third party packages are also available.
290290

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

293-
## wq.db
293+
## ModelRouter (wq.db.rest)
294294

295-
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.
295+
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.
296296

297-
from wq.db.rest import app
297+
from wq.db import rest
298298
from myapp.models import MyModel
299299

300-
app.router.register_model(MyModel)
300+
rest.router.register_model(MyModel)
301301

302302
## DRF-extensions
303303

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

0 commit comments

Comments
 (0)