-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: AUTHORS MANIFEST.in README.rst flask_mongoengine/templates/panels/mongo-panel.html flask_mongoengine/wtf/__init__.py flask_mongoengine/wtf/fields.py flask_mongoengine/wtf/orm.py setup.py tests.py
- Loading branch information
Showing
24 changed files
with
299 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
Ross Lawley <ross.lawley@gmail.com> | ||
Jorge Bastida <me@jorgebastida.com> | ||
Dan Jacob https://bitbucket.org/danjac | ||
Marat Khabibullin https://bitbucket.org/maratfm | ||
Jorge Bastida <me@jorgebastida.com> | ||
Streetlife.com | ||
atroche - https://github.com/atroche | ||
Rodrigue Cloutier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Metadata-Version: 1.0 | ||
Name: flask-mongoengine | ||
Version: 0.1 | ||
Summary: Flask support for MongoDB and with WTF model forms | ||
Home-page: https://github.com/mongoengine/flask-mongoengine | ||
Author: Ross Lawley | ||
Author-email: ross.lawley@gmail.com | ||
License: BSD | ||
Description: | ||
Flask-MongoEngine | ||
-------------- | ||
|
||
Flask support for MongoDB using MongoEngine. | ||
Includes `WTForms`_ support. | ||
|
||
Links | ||
````` | ||
|
||
* `development version | ||
<https://github.com/mongoengine/flask-mongoengine/raw/master#egg=Flask-MongoEngine-dev>`_ | ||
|
||
|
||
Platform: any | ||
Classifier: Development Status :: 4 - Beta | ||
Classifier: Environment :: Web Environment | ||
Classifier: Intended Audience :: Developers | ||
Classifier: License :: OSI Approved :: BSD License | ||
Classifier: Operating System :: OS Independent | ||
Classifier: Programming Language :: Python | ||
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content | ||
Classifier: Topic :: Software Development :: Libraries :: Python Modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
AUTHORS | ||
LICENSE | ||
MANIFEST.in | ||
README.rst | ||
setup.py | ||
Flask_MongoEngine.egg-info/PKG-INFO | ||
Flask_MongoEngine.egg-info/SOURCES.txt | ||
Flask_MongoEngine.egg-info/dependency_links.txt | ||
Flask_MongoEngine.egg-info/not-zip-safe | ||
Flask_MongoEngine.egg-info/requires.txt | ||
Flask_MongoEngine.egg-info/top_level.txt | ||
docs/Makefile | ||
docs/conf.py | ||
docs/index.rst | ||
docs/make.bat | ||
docs/_themes/README | ||
docs/_themes/flask_theme_support.py | ||
docs/_themes/flask/theme.conf | ||
docs/_themes/flask/static/flasky.css_t | ||
docs/_themes/flask_small/layout.html | ||
docs/_themes/flask_small/theme.conf | ||
docs/_themes/flask_small/static/flasky.css_t | ||
flask_mongoengine/__init__.py | ||
flask_mongoengine/operation_tracker.py | ||
flask_mongoengine/panels.py | ||
flask_mongoengine.egg-info/SOURCES.txt | ||
flask_mongoengine/templates/panels/mongo-panel.html | ||
flask_mongoengine/wtf/__init__.py | ||
flask_mongoengine/wtf/fields.py | ||
flask_mongoengine/wtf/models.py | ||
flask_mongoengine/wtf/orm.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Flask | ||
mongoengine | ||
flask-wtf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flask_mongoengine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Copyright (c) 2010-2011 See AUTHORS. | ||
Copyright (c) 2010-2012 See AUTHORS. | ||
|
||
Some rights reserved. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
include AUTHORS LICENSE tests.py | ||
include MANIFEST.in | ||
include README.rst | ||
include LICENSE | ||
include AUTHORS | ||
recursive-include flask_mongoengine/templates *.html | ||
recursive-include docs * | ||
recursive-exclude docs *.pyc | ||
recursive-exclude docs *.pyo | ||
prune docs/_build | ||
prune docs/_themes/.git | ||
prune docs/_themes/.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Sample app to test the toolbar | ||
============================== | ||
|
||
An example flask app - run `python simpleapp.py` and point your browser to localhost:4000/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from __future__ import with_statement | ||
|
||
import datetime | ||
import flask | ||
|
||
from random import choice | ||
|
||
from flask_mongoengine import MongoEngine | ||
from flask_mongoengine.wtf import model_form | ||
from flask_debugtoolbar import DebugToolbarExtension | ||
|
||
app = flask.Flask(__name__) | ||
app.config.from_object(__name__) | ||
app.config['MONGODB_DB'] = 'testing' | ||
app.config['TESTING'] = True | ||
app.config['SECRET_KEY'] = 'flask+mongoengine=<3' | ||
app.debug = True | ||
app.config['DEBUG_TB_PANELS'] = ( | ||
'flask_debugtoolbar.panels.versions.VersionDebugPanel', | ||
'flask_debugtoolbar.panels.timer.TimerDebugPanel', | ||
'flask_debugtoolbar.panels.headers.HeaderDebugPanel', | ||
'flask_debugtoolbar.panels.request_vars.RequestVarsDebugPanel', | ||
'flask_debugtoolbar.panels.template.TemplateDebugPanel', | ||
'flask_debugtoolbar.panels.logger.LoggingPanel', | ||
'flask_mongoengine.panels.MongoDebugPanel' | ||
) | ||
|
||
app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False | ||
|
||
db = MongoEngine() | ||
db.init_app(app) | ||
|
||
DebugToolbarExtension(app) | ||
|
||
|
||
class Todo(db.Document): | ||
title = db.StringField(max_length=60) | ||
text = db.StringField() | ||
done = db.BooleanField(default=False) | ||
pub_date = db.DateTimeField(default=datetime.datetime.now) | ||
|
||
@app.route('/') | ||
def index(): | ||
# As a list to test debug toolbar | ||
Todo.objects().delete() # Removes | ||
Todo(title="Simple todo A", text="12345678910").save() # Insert | ||
Todo(title="Simple todo B", text="12345678910").save() # Insert | ||
Todo.objects(title__contains="B").update(set__text="Hello world") # Update | ||
todos = list(Todo.objects[:10]) | ||
todos = Todo.objects.all() | ||
return flask.render_template('index.html', todos=todos) | ||
|
||
if __name__ == "__main__": | ||
app.run(host="0.0.0.0", port=4000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
body { font-family: sans-serif; background: #eee; } | ||
a, h1, h2 { color: #377BA8; } | ||
h1, h2 { font-family: 'Georgia', serif; margin: 0; } | ||
h1 { border-bottom: 2px solid #eee; } | ||
h2 { font-size: 1.2em; } | ||
|
||
.page { margin: 2em auto; width: 35em; border: 5px solid #ccc; | ||
padding: 0.8em; background: white; } | ||
.entries { list-style: none; margin: 0; padding: 0; } | ||
.entries li { margin: 0.8em 1.2em; } | ||
.entries li h2 { margin-left: -1em; } | ||
.add-entry { font-size: 0.9em; border-bottom: 1px solid #ccc; } | ||
.add-entry dl { font-weight: bold; } | ||
.metanav { text-align: right; font-size: 0.8em; padding: 0.3em; | ||
margin-bottom: 1em; background: #fafafa; } | ||
.flash { background: #CEE5F5; padding: 0.5em; | ||
border: 1px solid #AACBE2; } | ||
.error { background: #F0D6D6; padding: 0.5em; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% extends "layout.html" %} | ||
{% block body %} | ||
{% for todo in todos %} | ||
<div> | ||
<h2>{{ todo.title }}</h2> | ||
{{ todo.text|safe }} | ||
</div> | ||
{% else %} | ||
<em>Unbelievable. No todos here so far <a href="/add">Add one</a></em> | ||
{% endfor %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Flask MongoEngine</title> | ||
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}"> | ||
</head> | ||
<body> | ||
<div class=page> | ||
<h1>Toolbar example</h1> | ||
<div> | ||
{% block body %}{% endblock %} | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.