Skip to content

Commit

Permalink
Using make_document_class to create the document dinamically
Browse files Browse the repository at this point in the history
  • Loading branch information
fsouza committed Sep 10, 2011
1 parent e3b0887 commit 1de5fc1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flaskext/mongoalchemy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from mongoalchemy import document, exceptions, fields, session, query
from flask import abort

from flaskext.mongoalchemy.meta import make_document_class


def _include_mongoalchemy(obj):
for key in dir(fields):
Expand Down Expand Up @@ -89,7 +91,7 @@ def init_app():
"""

def __init__(self, app=None):
self.Document = Document
self.Document = make_document_class(self, Document)
self.Document.query = _QueryField(self)

_include_mongoalchemy(self)
Expand Down

0 comments on commit 1de5fc1

Please sign in to comment.