@click.command()<EOL>@click.argument("<STR_LIT:id>", type=int)<EOL>@click.option("<STR_LIT>", "<STR_LIT>", type=int, help="<STR_LIT>")<EOL>@click.option("<STR_LIT>", "<STR_LIT>", type=Decimal)<EOL>def edit(id: int, parent: int, alloc: Decimal):
saved = False<EOL>app = AppAggregate()<EOL>item = app.get(id)<EOL>if not item:<EOL><INDENT>raise KeyError("<STR_LIT>", id)<EOL><DEDENT>if parent:<EOL><INDENT>assert parent != id, "<STR_LIT>"<EOL>item.parentid = parent<EOL>saved = True<EOL><DEDENT>if alloc:<EOL><INDENT>assert alloc != Decimal(<NUM_LIT:0>)<EOL>item.allocation = alloc<EOL>saved = True<EOL><DEDENT>app.save()<EOL>if saved:<EOL><INDENT>click.echo("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>click.echo("<STR_LIT>")<EOL><DEDENT>
Edit asset class