Flask-ZODB 0.1
Use the ZODB with Flask
Downloads ↓ | Package Documentation
Transparent and scalable persistence of Python objects for Flask applications. Use it as your database or as a complement to another database - for example PostgreSQL where you need to perform rich queries and ZODB where you need structured data and mapping to and from Python types is inconvenient.
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'))
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| Flask-ZODB-0.1.tar.gz (md5) | Source | 2011-09-08 | 9KB | 400 | |
- Author: Dag Odenhall
- Documentation: Flask-ZODB package documentation
- Home Page: https://github.com/dag/flask-zodb
- Keywords: flask,zodb,persistence,database
- License: BSD
- Requires flask (>=0.7), ZODB, zodburi
-
Categories
- Development Status :: 3 - Alpha
- Environment :: Web Environment
- Framework :: ZODB
- Intended Audience :: Developers
- License :: OSI Approved :: BSD License
- Operating System :: OS Independent
- Programming Language :: Python :: 2.5
- Programming Language :: Python :: 2.6
- Programming Language :: Python :: 2.7
- Topic :: Database
- Topic :: Internet :: WWW/HTTP :: Dynamic Content
- Topic :: Software Development :: Libraries :: Python Modules
- Package Index Owner: dag
- DOAP record: Flask-ZODB-0.1.xml
