Description


Given the knowns of a recipe and a tiddler, determine the bag which is where the tiddler came from. Generally done to determine what bag we need to load from the store to (eventually) get the tiddler.

Parameters


Returns


Raises NoBagError if no bag containing the tiddler can be determined.

Example


    tiddler = Tiddler('somename')
    recipe = Recipe('foobar')
    recipe = store.get(recipe)
    bag = control.determine_tiddler_bag_from_recipe(recipe, tiddler)


Notes


This code is used when getting or deleting a tiddler via a recipe-based URL. When putting a tiddler via a recipe-based URL control.determine_bag_for_tiddler is used.

If an environ parameter is provided this is assumed to be a dict which is the WSGI environ. It is used to process the _recipe_template (see the source for details).