-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add edit/delete pages, enhance tables
- Loading branch information
1 parent
1937d8e
commit 148b3a0
Showing
8 changed files
with
123 additions
and
32 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
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
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
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
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
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
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,9 +1,27 @@ | ||
from iommi import Action | ||
from iommi import Page | ||
from iommi import Table | ||
from iommi import html | ||
|
||
from oar.animals.models import MedicalRecord | ||
|
||
class AnimalTable(Table): | ||
pass | ||
# Tables | ||
|
||
|
||
# Forms | ||
|
||
|
||
# Pages | ||
class AnimalPage(Page): | ||
title = html.h1(lambda params, **_: params.animal.name) | ||
actions__create_animal = Action( | ||
attrs__href="/animals/create/", | ||
) | ||
medical_records = Table( | ||
auto__model=MedicalRecord, | ||
rows=lambda params, **_: MedicalRecord.objects.filter(animal=params.animal), | ||
) | ||
|
||
|
||
class SpeciesTable(Table): | ||
class SpeciesPage(Page): | ||
pass |
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