Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Use the ZODB with Flask
Python
tree: c5451aba28

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs
examples/flaskr
.gitignore
.gitmodules
LICENSE
MANIFEST.in
Makefile
README.mkd
flask_zodb.py
logo.svg
setup.cfg
setup.py
tests.py
tox.ini
typewriter.svg

README.mkd

Flask-ZODB

Flask-ZODB

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.

Something went wrong with that request. Please try again.