-
Sub-task
-
Resolution: Unresolved
-
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.