File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,16 +64,30 @@ See ``python manage.py mktemplate --help`` for full details.
6464
6565Used for both the create and update views.
6666
67- ``neapolitan/object_list .html ``
67+ ``neapolitan/object_form .html ``
6868
6969Context variables:
7070
71- * ``object ``: the object being updated, if present.
71+ * ``object ``: the object being updated (for the update view)
7272* ``object_verbose_name ``: the verbose name of the object, e.g. ``bookmark ``.
7373* ``form ``: the form.
7474* ``create_view_url ``: the URL for the create view.
7575* ``update_view_url ``: the URL for the update view.
7676
77+ ``object_list.html ``
78+ --------------------
79+
80+ Used for the list view.
81+
82+ ``neapolitan/object_list.html ``
83+
84+ Context variables:
85+
86+ * ``object_list ``: the list of objects.
87+ * ``object_verbose_name ``: the verbose name of the object, e.g. ``bookmark ``.
88+ * ``object_verbose_name_plural ``: the plural verbose name, e.g. ``bookmarks ``.
89+ * ``create_view_url ``: the URL for the create view.
90+
7791``object_confirm_delete.html ``
7892------------------------------
7993
Original file line number Diff line number Diff line change @@ -378,6 +378,7 @@ def get_context_data(self, **kwargs):
378378
379379 if getattr (self , "object" , None ) is not None :
380380 kwargs ["object" ] = self .object
381+ kwargs ["update_view_url" ] = Role .UPDATE .maybe_reverse (self , self .object )
381382 context_object_name = self .get_context_object_name ()
382383 if context_object_name :
383384 kwargs [context_object_name ] = self .object
Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ def test_update(self):
136136 # Load the form.
137137 response = self .client .get (update_url )
138138 self .assertEqual (response .status_code , 200 )
139+ self .assertContains (response , f'action="/bookmark/{ self .homepage .pk } /edit/"' )
139140
140141 # Submit the form.
141142 response = self .client .post (
You can’t perform that action at this time.
0 commit comments