======= Views ======= A :term:`view` is the Python method responsible for handling a request..usually. The "view" can also refer to the class where the method is defined. The main view class used by the framework is :class:`~wuttaweb.views.master.MasterView`. This provides the typical CRUD features etc. A base :class:`~wuttaweb.views.base.View` class is also provided, for ad-hoc views which don't need all the features. The term :term:`view callable` is sometimes encountered; that comes from Pyramid and is a more accurate term for the methods which we usually just call "views" here. ``View`` -------- This base class can be used for custom views, but ``MasterView`` also inherits from it. All instances of :class:`~wuttaweb.views.base.View` will have these attributes: * :attr:`~wuttaweb.views.base.View.request` * :attr:`~wuttaweb.views.base.View.config` * :attr:`~wuttaweb.views.base.View.app` It also comes with some convenience methods: **Response** * :meth:`~wuttaweb.views.base.View.file_response()` * :meth:`~wuttaweb.views.base.View.json_response()` **Anomaly** * :meth:`~wuttaweb.views.base.View.forbidden()` * :meth:`~wuttaweb.views.base.View.notfound()` * :meth:`~wuttaweb.views.base.View.redirect()` **Helpers** * :meth:`~wuttaweb.views.base.View.make_form()` * :meth:`~wuttaweb.views.base.View.make_grid()` * :meth:`~wuttaweb.views.base.View.make_grid_action()` ``MasterView`` -------------- The :class:`~wuttaweb.views.master.MasterView` class inherits from ``View`` but adds many more features. Each master view class (normally) represents a data "model" of some kind. The view class can expose a "grid" which shows a table of the model data. It also can expose basic CRUD interfaces. Additional custom features may be "bolted on" to a subclass, which leverage and/or override some of the common features. .. toctree:: :maxdepth: 3 model config crud rowcrud settings