Uploaded image for project: 'SimplyE 2.0'
  1. SimplyE 2.0
  2. SIMPLY-3661 Implement new library search algorithm
  3. SIMPLY-3833

Standardize request-derived Library, Location via decorators, Flask global scope

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • SIMPLY S9 April 27 - May 11, SIMPLY S10 May 11 - May 25, SIMPLY S13 June 22 - July 6, SIMPLY S14 July 6 - July 20, SIMPLY S15 July 20 - Aug 3, SIMPLY S20 Sep 28 - Oct 12

      For inbound requests we sometimes need to parse / discover an associated Library or Location. Flask supplies a request context global, g, which can be used as storage for these kinds of objects. Specifically, for a request-related object which may or may not be present for a given request, placing it in the global request scope lets you delegate finding, validating, and parsing that object to a request decorator. Doing so avoids the more brittle method of parsing the URL into arguments to each view function.

      Library and Location for a request should be parsed and instantiated in decorators, and placed in the global context object. View functions should access the validated Library and/or Location from the global context object, rather than attempting to parse/validate those objects directly.

            NickBallenger Nick Ballenger (Inactive)
            NickBallenger Nick Ballenger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: