Base detail view.
This class inherits from:
This class implements all logic for retrieving a single object from the database, but does not implement rendering responses. See DetailView for an usage example.
Handler for GET requests.
This retrieves the object from the database and calls the render_to_response with the retrieved object in the context data.
Returns: | Ouput of render_to_response method implementation. |
---|
Detail view for rendering an object.
This class inherits from:
This class implements all logic for retrieving a single object from the database, including rendering a template.
Usage example:
class ArticleView(DetailView):
get_fields = {
'category': 'category',
'slug': 'slug',
}
document_class = Article
template_name = 'article_detail.html'
Mixin for retrieving a single object from the database.
The variable name to give this object in the template context. If None, it will get the name of the model class (Eg: a class Page would be available as page).
Document class from which the object should be retrieved.
See also
Return context data containing the retrieved object.
Returns: | A dict containing the retrieved object. |
---|
Return the context object name.
If SingleObjectMixin.context_object_name is set, that value will be returned, else it will use the lowercased name of the model set in SingleObjectMixin.document_class.
Returns: | A str representing the object name. |
---|
A dict containing the fieldname mapped against the URL variable name. For example when you have the URL route '/<category>/<author>/', and the following setting:
get_fields = {
'cat': 'category',
'user': 'author',
}
When requesting /news/john/, it would perform the following query: get(cat='news', user='john').
Retrieve the object from the database.
Returns: | An instance of the model class containing the retrieved object. |
---|---|
Raise : | werkzeug.exceptions.NotFound when the document does not exist. |
Return QuerySet class used to retrieve objects.
Returns: | An instance of mongoengine.queryset.QuerySet. |
---|