ramka.views package#
Submodules#
ramka.views.base_view module#
- class ramka.views.base_view.BaseView#
Bases:
ABC
Base class for all class-based views.
A class-based view is a view that is defined by a class. It defines methods for all supported request methods.
- delete(request: Request, response: Response, **kwargs) None #
DELETE HTTP method handler.
It should be overridden in subclasses to enable support for the DELETE HTTP method.
- get(request: Request, response: Response, **kwargs) None #
GET HTTP method handler.
It should be overridden in subclasses to enable support for the GET HTTP method.
- patch(request: Request, response: Response, **kwargs) None #
PATCH HTTP method handler.
It should be overridden in subclasses to enable support for the PATCH HTTP method.
ramka.views.errors module#
- ramka.views.errors.default_error_handler(_, response, error: Exception)#
The default handler for all unhandled exceptions.
It sends a 500 error page to the client as all unhandles exceptions are considered as server errors. Instead of sending a genetic 500 error page, it sends a JSON response with the error message.
- ramka.views.errors.http_404_not_found(_, response)#
The default 404 handler.
It sends a 404 error page to the client.
- ramka.views.errors.http_405_method_not_allowed(_, response)#
The default handler for methods that have not been implemented.
Module contents#
- class ramka.views.BaseView#
Bases:
ABC
Base class for all class-based views.
A class-based view is a view that is defined by a class. It defines methods for all supported request methods.
- delete(request: Request, response: Response, **kwargs) None #
DELETE HTTP method handler.
It should be overridden in subclasses to enable support for the DELETE HTTP method.
- get(request: Request, response: Response, **kwargs) None #
GET HTTP method handler.
It should be overridden in subclasses to enable support for the GET HTTP method.
- patch(request: Request, response: Response, **kwargs) None #
PATCH HTTP method handler.
It should be overridden in subclasses to enable support for the PATCH HTTP method.
- ramka.views.default_error_handler(_, response, error: Exception)#
The default handler for all unhandled exceptions.
It sends a 500 error page to the client as all unhandles exceptions are considered as server errors. Instead of sending a genetic 500 error page, it sends a JSON response with the error message.
- ramka.views.http_404_not_found(_, response)#
The default 404 handler.
It sends a 404 error page to the client.
- ramka.views.http_405_method_not_allowed(_, response)#
The default handler for methods that have not been implemented.