File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 33from hello import views
44from hello .models import LogMessage
55
6+ home_list_view = views .HomeListView .as_view (
7+ queryset = LogMessage .objects .order_by ("-log_date" )[:5 ], # :5 limits the results to the five most recent
8+ context_object_name = "message_list" ,
9+ template_name = "hello/home.html" ,
10+ )
11+
612urlpatterns = [
7- path (
8- "" ,
9- views .HomeListView .as_view (
10- queryset = LogMessage .objects .order_by ("-log_date" )[
11- :5 # :5 limits the results to the five most recent
12- ],
13- context_object_name = "message_list" ,
14- template_name = "hello/home.html" ,
15- ),
16- name = "home" ,
17- ),
13+ path ("" , home_list_view , name = "home" ),
1814 path ("hello/<name>" , views .hello_there , name = "hello_there" ),
1915 path ("about/" , views .about , name = "about" ),
2016 path ("contact/" , views .contact , name = "contact" ),
You can’t perform that action at this time.
0 commit comments