Description


Determine which bag in a recipe a tiddler could be saved into.

Parameters


Returns


Raises NoBagError if no bag can be found.

Example


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


Notes


This is primarily used when putting a tiddler to recipe-based URL (which doesn't happen a lot, you should PUT a tiddler to a bag-based URL). Generally, unless the last bag in the recipe has a filter on it, the last bag is what will be returned from this method.

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).