def _parse_stack(self, req, old=False): return CardStack( req.args.get('old_stack_name' if old else 'stack'), int(req.args.get('old_stack_version' if old else 'stack_version')))
def serialized_stacks_by_name(stacks, stack_names): stacks_by_name = dict((stack.name, stack.serialized()) for stack in stacks) for name in stack_names: stacks_by_name.setdefault(name, CardStack(name, 0).serialized()) return stacks_by_name