Home / Function/ record_once() — flask Function Reference

record_once() — flask Function Reference

Architecture documentation for the record_once() function in blueprints.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  0085606d_b5d3_d0dc_0155_6135d079c059["record_once()"]
  0c59fa87_9a90_f011_4207_98ae96479921["Blueprint"]
  0085606d_b5d3_d0dc_0155_6135d079c059 -->|defined in| 0c59fa87_9a90_f011_4207_98ae96479921
  0e94cea7_d7a3_238f_715d_5d59f6552fb2["add_app_template_filter()"]
  0e94cea7_d7a3_238f_715d_5d59f6552fb2 -->|calls| 0085606d_b5d3_d0dc_0155_6135d079c059
  c7990db6_32eb_56c3_6c6d_cf5cd0dbb933["add_app_template_test()"]
  c7990db6_32eb_56c3_6c6d_cf5cd0dbb933 -->|calls| 0085606d_b5d3_d0dc_0155_6135d079c059
  377f4c39_a79f_f005_76ce_f8af5079fd4c["add_app_template_global()"]
  377f4c39_a79f_f005_76ce_f8af5079fd4c -->|calls| 0085606d_b5d3_d0dc_0155_6135d079c059
  d07d5dbc_1239_d035_ea45_26bae0c1577a["before_app_request()"]
  d07d5dbc_1239_d035_ea45_26bae0c1577a -->|calls| 0085606d_b5d3_d0dc_0155_6135d079c059
  dcc61990_260c_6cd0_006b_4c083cab4568["after_app_request()"]
  dcc61990_260c_6cd0_006b_4c083cab4568 -->|calls| 0085606d_b5d3_d0dc_0155_6135d079c059
  54d7cb01_4a66_b01f_fe7e_8120c692e11b["teardown_app_request()"]
  54d7cb01_4a66_b01f_fe7e_8120c692e11b -->|calls| 0085606d_b5d3_d0dc_0155_6135d079c059
  888e3108_3bb1_6ec1_2b10_88e5f028018d["app_context_processor()"]
  888e3108_3bb1_6ec1_2b10_88e5f028018d -->|calls| 0085606d_b5d3_d0dc_0155_6135d079c059
  da9ef7e9_1774_18fd_3b97_c5ab1886cd8d["app_errorhandler()"]
  da9ef7e9_1774_18fd_3b97_c5ab1886cd8d -->|calls| 0085606d_b5d3_d0dc_0155_6135d079c059
  107cfe1a_9519_57b7_14d9_15efcf8111bb["app_url_value_preprocessor()"]
  107cfe1a_9519_57b7_14d9_15efcf8111bb -->|calls| 0085606d_b5d3_d0dc_0155_6135d079c059
  0e81c3a3_1478_6693_3a34_22703d36543b["app_url_defaults()"]
  0e81c3a3_1478_6693_3a34_22703d36543b -->|calls| 0085606d_b5d3_d0dc_0155_6135d079c059
  0b82c064_d082_834e_b86a_ea458a961988["record()"]
  0085606d_b5d3_d0dc_0155_6135d079c059 -->|calls| 0b82c064_d082_834e_b86a_ea458a961988
  style 0085606d_b5d3_d0dc_0155_6135d079c059 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/sansio/blueprints.py lines 233–244

    def record_once(self, func: DeferredSetupFunction) -> None:
        """Works like :meth:`record` but wraps the function in another
        function that will ensure the function is only called once.  If the
        blueprint is registered a second time on the application, the
        function passed is not called.
        """

        def wrapper(state: BlueprintSetupState) -> None:
            if state.first_registration:
                func(state)

        self.record(update_wrapper(wrapper, func))

Subdomains

Calls

Frequently Asked Questions

What does record_once() do?
record_once() is a function in the flask codebase, defined in src/flask/sansio/blueprints.py.
Where is record_once() defined?
record_once() is defined in src/flask/sansio/blueprints.py at line 233.
What does record_once() call?
record_once() calls 1 function(s): record.
What calls record_once()?
record_once() is called by 10 function(s): add_app_template_filter, add_app_template_global, add_app_template_test, after_app_request, app_context_processor, app_errorhandler, app_url_defaults, app_url_value_preprocessor, and 2 more.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free