/', methods=['GET', 'POST'])
def edit_entry(entry_id):
try:
entry = Entry.get(id=entry_id)
except Entry.DoesNotExist:
abort(404)
if request.method == 'POST':
form = EntryForm(request.form, obj=entry)
if form.validate():
form.populate_obj(entry)
entry.save()
flash('Your entry has been saved')
else:
form = EntryForm(obj=entry)
return render_template('blog/entry_edit.html', form=form, entry=entry)
```
Example template for above view:
```jinja
{% extends "layout.html" %}
{% block body %}
Edit {{ entry.title }}
{% endblock %}
```
wtf-peewee-0.2.6/setup.cfg 0000644 0001750 0000144 00000000073 12627466573 016232 0 ustar charles users 0000000 0000000 [egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
wtf-peewee-0.2.6/setup.py 0000644 0001750 0000144 00000001474 12627466550 016124 0 ustar charles users 0000000 0000000 from setuptools import setup
setup(
name='wtf-peewee',
version='0.2.6',
url='https://github.com/coleifer/wtf-peewee/',
license='MIT',
author='Charles Leifer',
author_email='coleifer@gmail.com',
description='WTForms integration for peewee models',
packages=['wtfpeewee'],
zip_safe=False,
platforms='any',
install_requires=[
'peewee>=2.0.0', 'wtforms',
],
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
],
test_suite='runtests.runtests'
)
wtf-peewee-0.2.6/wtf_peewee.egg-info/ 0000755 0001750 0000144 00000000000 12627466573 020235 5 ustar charles users 0000000 0000000 wtf-peewee-0.2.6/wtf_peewee.egg-info/not-zip-safe 0000644 0001750 0000144 00000000001 11663517576 022462 0 ustar charles users 0000000 0000000
wtf-peewee-0.2.6/wtf_peewee.egg-info/dependency_links.txt 0000644 0001750 0000144 00000000001 12627466573 024303 0 ustar charles users 0000000 0000000
wtf-peewee-0.2.6/wtf_peewee.egg-info/requires.txt 0000644 0001750 0000144 00000000026 12627466573 022633 0 ustar charles users 0000000 0000000 peewee>=2.0.0
wtforms
wtf-peewee-0.2.6/wtf_peewee.egg-info/top_level.txt 0000644 0001750 0000144 00000000012 12627466573 022760 0 ustar charles users 0000000 0000000 wtfpeewee
wtf-peewee-0.2.6/wtf_peewee.egg-info/SOURCES.txt 0000644 0001750 0000144 00000002015 12627466573 022117 0 ustar charles users 0000000 0000000 LICENSE
MANIFEST.in
README.md
runtests.py
setup.py
example/app.py
example/example.db
example/static/css/bootstrap.css
example/static/css/bootstrap.min.css
example/static/css/style.css
example/static/js/bootstrap-alerts.js
example/static/js/bootstrap-dropdown.js
example/static/js/bootstrap-modal.js
example/static/js/bootstrap-popover.js
example/static/js/bootstrap-scrollspy.js
example/static/js/bootstrap-tabs.js
example/static/js/bootstrap-twipsy.js
example/static/js/jquery-1.4.2.min.js
example/templates/base.html
example/templates/includes/comments.html
example/templates/posts/add.html
example/templates/posts/base_post.html
example/templates/posts/detail.html
example/templates/posts/edit.html
example/templates/posts/index.html
wtf_peewee.egg-info/PKG-INFO
wtf_peewee.egg-info/SOURCES.txt
wtf_peewee.egg-info/dependency_links.txt
wtf_peewee.egg-info/not-zip-safe
wtf_peewee.egg-info/requires.txt
wtf_peewee.egg-info/top_level.txt
wtfpeewee/__init__.py
wtfpeewee/_compat.py
wtfpeewee/fields.py
wtfpeewee/orm.py
wtfpeewee/tests.py wtf-peewee-0.2.6/wtf_peewee.egg-info/PKG-INFO 0000644 0001750 0000144 00000001152 12627466573 021331 0 ustar charles users 0000000 0000000 Metadata-Version: 1.1
Name: wtf-peewee
Version: 0.2.6
Summary: WTForms integration for peewee models
Home-page: https://github.com/coleifer/wtf-peewee/
Author: Charles Leifer
Author-email: coleifer@gmail.com
License: MIT
Description: UNKNOWN
Platform: any
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
wtf-peewee-0.2.6/PKG-INFO 0000644 0001750 0000144 00000001152 12627466573 015505 0 ustar charles users 0000000 0000000 Metadata-Version: 1.1
Name: wtf-peewee
Version: 0.2.6
Summary: WTForms integration for peewee models
Home-page: https://github.com/coleifer/wtf-peewee/
Author: Charles Leifer
Author-email: coleifer@gmail.com
License: MIT
Description: UNKNOWN
Platform: any
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
wtf-peewee-0.2.6/LICENSE 0000644 0001750 0000144 00000002042 11651637427 015406 0 ustar charles users 0000000 0000000 Copyright (c) 2010 Charles Leifer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.