mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Merge pull request #1289 from sheppard/wqdb-router
third-party package: wq.db
This commit is contained in:
commit
b07eb0bf0d
|
@ -150,4 +150,18 @@ If you want to provide totally custom behavior, you can override `BaseRouter` an
|
|||
|
||||
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 are also available.
|
||||
|
||||
## wq.db
|
||||
|
||||
[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.
|
||||
|
||||
from wq.db.rest import app
|
||||
from .models import MyModel
|
||||
app.router.register_model(MyModel)
|
||||
|
||||
[cite]: http://guides.rubyonrails.org/routing.html
|
||||
[wq.db]: http://wq.io/wq.db
|
||||
[wq.db-router]: http://wq.io/docs/app.py
|
||||
|
|
Loading…
Reference in New Issue
Block a user