Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dag/flask-zodb
Use the ZODB with Flask
https://github.com/dag/flask-zodb
Last synced: 6 days ago
JSON representation
Use the ZODB with Flask
- Host: GitHub
- URL: https://github.com/dag/flask-zodb
- Owner: dag
- License: bsd-2-clause
- Created: 2011-01-08T22:25:10.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-10-12T19:46:43.000Z (about 13 years ago)
- Last Synced: 2024-11-01T01:33:19.015Z (13 days ago)
- Language: Python
- Homepage: http://pypi.python.org/pypi/Flask-ZODB
- Size: 478 KB
- Stars: 41
- Watchers: 7
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.mkd
- License: LICENSE
Awesome Lists containing this project
README
Flask-ZODB
----------![Flask-ZODB][logo]
Simple extension for integrating the ZODB in Flask applications.
```python
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][docs].
[docs]: http://packages.python.org/Flask-ZODB/
[logo]: https://github.com/dag/flask-zodb/raw/master/docs/_static/flask-zodb.png