Skip to content

Commit

Permalink
Added request handlers to reference docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
carltongibson committed Mar 24, 2024
1 parent c908766 commit 3436085
Showing 1 changed file with 60 additions and 2 deletions.
62 changes: 60 additions & 2 deletions docs/source/crud-view.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,65 @@
CRUDView Reference
==================

.. autoclass:: neapolitan.views.CRUDView
.. py:currentmodule:: neapolitan.views
.. autoclass:: CRUDView

.. automethod:: neapolitan.views.CRUDView.get_context_data
Request Handlers
================

The core of a class-based view are the request handlers — methods that convert an HTTP request into a response. The request handers are the essence of the **view**.

Neapolitan's ``CRUDView`` provides handlers the standard list, detail, create, edit, and delete views for a model.

List and Detail Views
----------------------

.. automethod:: CRUDView.list

.. literalinclude:: ../../src/neapolitan/views.py
:pyobject: CRUDView.list

.. automethod:: CRUDView.detail

.. literalinclude:: ../../src/neapolitan/views.py
:pyobject: CRUDView.detail

Create and Update Views
-----------------------

.. automethod:: CRUDView.show_form

.. literalinclude:: ../../src/neapolitan/views.py
:pyobject: CRUDView.show_form

.. automethod:: CRUDView.process_form

.. literalinclude:: ../../src/neapolitan/views.py
:pyobject: CRUDView.process_form

Delete View
-----------

.. automethod:: CRUDView.confirm_delete

.. literalinclude:: ../../src/neapolitan/views.py
:pyobject: CRUDView.confirm_delete

.. automethod:: CRUDView.process_deletion

.. literalinclude:: ../../src/neapolitan/views.py
:pyobject: CRUDView.process_deletion






Other Methods
=============

.. automethod:: CRUDView.get_context_data

.. literalinclude:: ../../src/neapolitan/views.py
:pyobject: CRUDView.get_context_data

0 comments on commit 3436085

Please sign in to comment.