-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update patterns usage (see wq/wq.db#34)
- Loading branch information
Showing
3 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from wq.db.patterns import admin | ||
from django.contrib import admin | ||
from wq.db.patterns import admin as patterns | ||
from .models import Example | ||
|
||
|
||
admin.site.register(Example, admin.IdentifiedModelAdmin) | ||
admin.site.register(Example, patterns.IdentifiedModelAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from wq.db.patterns import models | ||
from django.db import models | ||
from wq.db.patterns import models as patterns | ||
|
||
|
||
class Example(models.IdentifiedModel): | ||
class Example(patterns.IdentifiedModel): | ||
name = models.CharField(max_length=255) | ||
description = models.TextField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
from wq.db.rest import app | ||
from wq.db.patterns import rest as patterns | ||
from .models import Example | ||
|
||
|
||
app.router.register_model(Example) | ||
app.router.register_model( | ||
Example, | ||
serializer=patterns.IdentifiedModelSerializer | ||
) | ||
app.router.add_page('index', {'url': ''}) |