Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

jgoret/flask-zodb

 
 

Repository files navigation

Flask-ZODB

Flask-ZODB

Build Status Coverage Status

Simple extension for integrating the ZODB in Flask applications.

app = Flask(__name__)
db = ZODB(app)

@app.before_request
def set_db_defaults():
    if 'entries' not in db:
        db['entries'] = List()

@app.route('/')
def show_entries():
    return render_template('show_entries.html', entries=db['entries'])


@app.route('/add', methods=['POST'])
def add_entry():
    db['entries'].append(request.form)
    flash('New entry was successfully posted')
    return redirect(url_for('show_entries'))

For more information see the documentation.

Packages

No packages published

Languages

  • Python 97.0%
  • Makefile 3.0%