Add documentation and source
Added documentation, source and extra files.
This commit is contained in:
13
source/orm/library/views/base.py
Normal file
13
source/orm/library/views/base.py
Normal file
@ -0,0 +1,13 @@
|
||||
from annoying.decorators import render_to
|
||||
from django.http import HttpRequest
|
||||
from django.views.decorators.cache import cache_page
|
||||
|
||||
from library.models import Person, Book
|
||||
|
||||
|
||||
@cache_page(30)
|
||||
@render_to("library/index-page.html")
|
||||
def view_index(request: HttpRequest) -> dict: # noqa
|
||||
people = Person.objects.all()
|
||||
books = Book.objects.all()
|
||||
return {"people": people, "books": books}
|
Reference in New Issue
Block a user