Permalink
Browse files

Fix import name in documentation and doc strings

  • Loading branch information...
1 parent d56b1bc commit 0727b50f46bf170794e35862c9e8f84cd3b9f09c @jarus committed Feb 23, 2012
Showing with 8 additions and 7 deletions.
  1. +2 −2 docs/index.rst
  2. +6 −5 flask_mongokit.py
View
@@ -1,7 +1,7 @@
==============
Flask-MongoKit
==============
-.. currentmodule:: flaskext.mongokit
+.. currentmodule:: flask.ext.mongokit
Flask-MongoKit simplifies to use `MongoKit`_, a powerful `MongoDB`_ ORM
in Flask applications. If you find bugs or want to support this extension you can find the source code `here`_.
@@ -59,7 +59,7 @@ It is very simple to use MongoKit in your Flask application. Let's create a simp
db = MongoKit(app)
db.register([Task])
-As you can see we create a document model as class *Task* which uses Document from flaskext.mongokit as parent class. In this model we describe the structure of our document and we can set a list of required fields and default values. The :class:`flaskext.mongokit.Document` is beside some extensions the same like :class:`mongokit.Document` so if you want to know more about the core features of the Document class please look into the `MongoKit documentation`_. For using the the document model we must register it with the connection. But we use the :meth:`~flaskext.mongokit.MongoKit.register` method from the :class:`flaskext.mongokit.MongoKit` class.
+As you can see we create a document model as class *Task* which uses Document from flask.ext.mongokit as parent class. In this model we describe the structure of our document and we can set a list of required fields and default values. The :class:`flask.ext.mongokit.Document` is beside some extensions the same like :class:`mongokit.Document` so if you want to know more about the core features of the Document class please look into the `MongoKit documentation`_. For using the the document model we must register it with the connection. But we use the :meth:`~flask.ext.mongokit.MongoKit.register` method from the :class:`flask.ext.mongokit.MongoKit` class.
Now we need a view to add a new task like this.
View
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
- flaskext.mongokit
- ~~~~~~~~~~~~~~~~~
+ flask.ext.mongokit
+ ~~~~~~~~~~~~~~~~~~
Flask-MongoKit simplifies to use MongoKit, a powerful MongoDB ORM in Flask
applications.
@@ -30,7 +30,7 @@ def show_task(task_id):
It checks the validate of the id and converts it into a
:class:`bson.objectid.ObjectId` object. The converter will be
automatically registered by the initialization of
- :class:`~flaskext.mongokit.MongoKit` with keyword :attr:`ObjectId`.
+ :class:`~flask.ext.mongokit.MongoKit` with keyword :attr:`ObjectId`.
"""
def to_python(self, value):
@@ -58,7 +58,7 @@ def get_or_404(self, id):
def find_one_or_404(self, *args, **kwargs):
"""This method get one document over normal query parameter like
- :meth:`~flaskext.mongokit.Document.find_one` but if there no document
+ :meth:`~flask.ext.mongokit.Document.find_one` but if there no document
then it will raise a 404 error.
"""
@@ -96,7 +96,8 @@ def init_app(self, app):
MongoKit opens a connection to your MongoDB host on a request and
closes after the response.
- Also it registers the :class:`flaskext.mongokit.BSONObjectIdConverter`
+ Also it registers the
+ :class:`flask.ext.mongokit.BSONObjectIdConverter`
as a converter with the key word **ObjectId**.
:param app: The Flask application will be bound to this MongoKit

0 comments on commit 0727b50

Please sign in to comment.