Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « flask.blueprints »

Classe « Scaffold »

Informations générales

Héritage

builtins.object
    Scaffold

Définition

class Scaffold(builtins.object):

Description [extrait de Scaffold.__doc__]

Common behavior shared between :class:`~flask.Flask` and
    :class:`~flask.blueprints.Blueprint`.

    :param import_name: The import name of the module where this object
        is defined. Usually :attr:`__name__` should be used.
    :param static_folder: Path to a folder of static files to serve.
        If this is set, a static route will be added.
    :param static_url_path: URL prefix for the static route.
    :param template_folder: Path to a folder containing template files.
        for rendering. If this is set, a Jinja loader will be added.
    :param root_path: The path that static, template, and resource files
        are relative to. Typically not set, it is discovered based on
        the ``import_name``.

    .. versionadded:: 2.0
    

Constructeur(s)

Signature du constructeur Description
__init__(self, import_name: str, static_folder: Union[str, os.PathLike, NoneType] = None, static_url_path: Optional[str] = None, template_folder: Optional[str] = None, root_path: Optional[str] = None)

Liste des attributs statiques

Nom de l'attribut Valeur
json_decoderNone
json_encoderNone

Liste des propriétés

Nom de la propriétéDescription
has_static_folder``True`` if :attr:`static_folder` is set. [extrait de __doc__]
jinja_loaderThe Jinja loader for this object's templates. By default this [extrait de jinja_loader.__doc__]
static_folderThe absolute path to the configured static folder. ``None`` [extrait de __doc__]
static_url_pathThe URL prefix that the static route will be accessible from. [extrait de __doc__]

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__repr__(self) -> str
add_url_rule(self, rule: str, endpoint: Optional[str] = None, view_func: Optional[Callable] = None, provide_automatic_options: Optional[bool] = None, **options: Any) -> None Register a rule for routing incoming requests and building [extrait de add_url_rule.__doc__]
after_request(self, f: Callable[[ForwardRef('Response')], ForwardRef('Response')]) -> Callable[[ForwardRef('Response')], ForwardRef('Response')] Register a function to run after each request to this object. [extrait de after_request.__doc__]
before_request(self, f: Callable[[], Union[ForwardRef('Response'), ~AnyStr, Dict[str, Any], Generator[~AnyStr, NoneType, NoneType], Tuple[Union[ForwardRef('Response'), ~AnyStr, Dict[str, Any], Generator[~AnyStr, NoneType, NoneType]], Union[ForwardRef('Headers'), Dict[str, Union[str, List[str], Tuple[str, ...]]], List[Tuple[str, Union[str, List[str], Tuple[str, ...]]]]]], Tuple[Union[ForwardRef('Response'), ~AnyStr, Dict[str, Any], Generator[~AnyStr, NoneType, NoneType]], int], Tuple[Union[ForwardRef('Response'), ~AnyStr, Dict[str, Any], Generator[~AnyStr, NoneType, NoneType]], int, Union[ForwardRef('Headers'), Dict[str, Union[str, List[str], Tuple[str, ...]]], List[Tuple[str, Union[str, List[str], Tuple[str, ...]]]]]], ForwardRef('WSGIApplication'), NoneType]]) -> Callable[[], Union[ForwardRef('Response'), ~AnyStr, Dict[str, Any], Generator[~AnyStr, NoneType, NoneType], Tuple[Union[ForwardRef('Response'), ~AnyStr, Dict[str, Any], Generator[~AnyStr, NoneType, NoneType]], Union[ForwardRef('Headers'), Dict[str, Union[str, List[str], Tuple[str, ...]]], List[Tuple[str, Union[str, List[str], Tuple[str, ...]]]]]], Tuple[Union[ForwardRef('Response'), ~AnyStr, Dict[str, Any], Generator[~AnyStr, NoneType, NoneType]], int], Tuple[Union[ForwardRef('Response'), ~AnyStr, Dict[str, Any], Generator[~AnyStr, NoneType, NoneType]], int, Union[ForwardRef('Headers'), Dict[str, Union[str, List[str], Tuple[str, ...]]], List[Tuple[str, Union[str, List[str], Tuple[str, ...]]]]]], ForwardRef('WSGIApplication'), NoneType]] Register a function to run before each request. [extrait de before_request.__doc__]
context_processor(self, f: Callable[[], Dict[str, Any]]) -> Callable[[], Dict[str, Any]] Registers a template context processor function. [extrait de context_processor.__doc__]
delete(self, rule: str, **options: Any) -> Callable Shortcut for :meth:`route` with ``methods=["DELETE"]``. [extrait de delete.__doc__]
endpoint(self, endpoint: str) -> Callable Decorate a view function to register it for the given [extrait de endpoint.__doc__]
errorhandler(self, code_or_exception: Union[Type[-GenericException], int]) -> Callable[[ForwardRef('ErrorHandlerCallable[GenericException]')], ForwardRef('ErrorHandlerCallable[GenericException]')] Register a function to handle errors by code or exception class. [extrait de errorhandler.__doc__]
get(self, rule: str, **options: Any) -> Callable Shortcut for :meth:`route` with ``methods=["GET"]``. [extrait de get.__doc__]
get_send_file_max_age(self, filename: Optional[str]) -> Optional[int] Used by :func:`send_file` to determine the ``max_age`` cache [extrait de get_send_file_max_age.__doc__]
open_resource(self, resource: str, mode: str = 'rb') -> IO[~AnyStr] Open a resource file relative to :attr:`root_path` for [extrait de open_resource.__doc__]
patch(self, rule: str, **options: Any) -> Callable Shortcut for :meth:`route` with ``methods=["PATCH"]``. [extrait de patch.__doc__]
post(self, rule: str, **options: Any) -> Callable Shortcut for :meth:`route` with ``methods=["POST"]``. [extrait de post.__doc__]
put(self, rule: str, **options: Any) -> Callable Shortcut for :meth:`route` with ``methods=["PUT"]``. [extrait de put.__doc__]
register_error_handler(self, code_or_exception: Union[Type[-GenericException], int], f: 'ErrorHandlerCallable[GenericException]') -> None Alternative error attach function to the :meth:`errorhandler` [extrait de register_error_handler.__doc__]
route(self, rule: str, **options: Any) -> Callable Decorate a view function to register it with the given URL [extrait de route.__doc__]
send_static_file(self, filename: str) -> 'Response' The view function used to serve files from [extrait de send_static_file.__doc__]
teardown_request(self, f: Callable[[Optional[BaseException]], NoneType]) -> Callable[[Optional[BaseException]], NoneType] Register a function to be run at the end of each request, [extrait de teardown_request.__doc__]
url_defaults(self, f: Callable[[str, dict], NoneType]) -> Callable[[str, dict], NoneType] Callback function for URL defaults for all view functions of the [extrait de url_defaults.__doc__]
url_value_preprocessor(self, f: Callable[[Optional[str], Optional[dict]], NoneType]) -> Callable[[Optional[str], Optional[dict]], NoneType] Register a URL value preprocessor function for all view [extrait de url_value_preprocessor.__doc__]

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __hash__, __init_subclass__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__