MongoEngine / flask-mongoengine

MongoEngine flask extension with WTF model forms support
Other
840 stars 256 forks source link

Debugtoolbar error when inserting using Class._get_collection().insert () #30

Closed ddorian closed 11 years ago

ddorian commented 11 years ago
from flask import Flask
from mongoengine import *
from flask_debugtoolbar import DebugToolbarExtension
from flask_mongoengine import MongoEngine

db = MongoEngine()

app = Flask(__name__)
app.config['MONGODB_DB'] = 'test'
app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
app.config['DEBUG_TB_PANELS'] = (
    'flask.ext.debugtoolbar.panels.versions.VersionDebugPanel',
    'flask.ext.debugtoolbar.panels.timer.TimerDebugPanel',
    'flask.ext.debugtoolbar.panels.headers.HeaderDebugPanel',
    'flask.ext.debugtoolbar.panels.request_vars.RequestVarsDebugPanel',
    'flask.ext.debugtoolbar.panels.template.TemplateDebugPanel',
    'flask.ext.debugtoolbar.panels.logger.LoggingPanel',
    'flask_debugtoolbar.panels.profiler.ProfilerDebugPanel',
    'flask.ext.mongoengine.panels.MongoDebugPanel',
    )
app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'

app.debug = True
db.init_app(app)
DebugToolbarExtension(app)

class Projection(db.Document):
    sequence = StringField()

@app.route('/')
def testing():
    Projection._get_collection().insert({'a':1234})

    return ''

if __name__ == '__main__':
    app.run()
rozza commented 11 years ago

Working in 0.7 branch.