How to use the ihatemoney.models.db.session.delete function in ihatemoney

To help you get started, we’ve selected a few ihatemoney examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spiral-project / ihatemoney / ihatemoney / manage.py View on Github external
def run(self, project_name):
        demo_project = Project.query.get(project_name)
        db.session.delete(demo_project)
        db.session.commit()
github spiral-project / ihatemoney / ihatemoney / api.py View on Github external
def delete(self, project):
        db.session.delete(project)
        db.session.commit()
        return "DELETED"
github spiral-project / ihatemoney / ihatemoney / web.py View on Github external
def delete_bill(bill_id):
    # fixme: everyone is able to delete a bill
    bill = Bill.query.get(g.project, bill_id)
    if not bill:
        return redirect(url_for(".list_bills"))

    db.session.delete(bill)
    db.session.commit()
    flash(_("The bill has been deleted"))

    return redirect(url_for(".list_bills"))