def add(): form = ServiceGroupForm() facade = Facade(form=form) if form.validate_on_submit(): result = g.proxies.ServiceGroups.create(**data) facade.successful = True return facade
def edit(service_group_id): serviceGroup = g.proxies.ServiceGroups.from_id(service_group_id) if not serviceGroup: abort(404) form = ServiceGroupForm(**serviceGroup['ServiceGroup']) facade = Facade(form=form, serviceGroup=serviceGroup) if form.validate_on_submit(): result = g.proxies.ServiceGroups.update(service_group_id, **form.data) facade.successful = True return facade