|
OpenQuizz
Une application de gestion des contenus pédagogiques
|


Public Member Functions | |
| def | to_python (self, value) |
| def | to_url (self, value) |
Public Member Functions inherited from BaseConverter | |
| def | __init__ (self, map) |
Additional Inherited Members | |
Data Fields inherited from BaseConverter | |
| map | |
Static Public Attributes inherited from BaseConverter | |
| regex | |
| weight | |
A simple converter for the RESTful URL routing system of Flask.
.. code-block:: python
@app.route("/<ObjectId:task_id>")
def show_task(task_id):
task = mongo.db.tasks.find_one_or_404(task_id)
return render_template("task.html", task=task)
Valid object ID strings are converted into
:class:`~bson.objectid.ObjectId` objects; invalid strings result
in a 404 error. The converter is automatically registered by the
initialization of :class:`~flask_pymongo.PyMongo` with keyword
:attr:`ObjectId`. | def to_python | ( | self, | |
| value | |||
| ) |
Reimplemented from BaseConverter.
| def to_url | ( | self, | |
| value | |||
| ) |
Reimplemented from BaseConverter.