CRUDView Reference

class neapolitan.views.CRUDView(**kwargs)

CRUDView is Neapolitan’s core. It provides the standard list, detail, create, edit, and delete views for a model, as well as the hooks you need to be able to customise any part of that.

CRUDView.get_context_data(**kwargs)

Returns a dictionary to use as the context of the response.

Takes a set of keyword arguments to use as the base context, and adds the following keys:

  • view: A reference to the view object itself.

  • The object_verbose_name and object_verbose_name_plural of the model.

  • object or object_list: The object or list of objects being displayed, plus more user-friendly versions using the model, such as bookmark or bookmark_list.

  • create_view_url: The URL of the create view