Views#
- class lotus.views.ArticleDetailView(*args, **kwargs)[source]#
Article detail.
- class lotus.views.AuthorIndexView(**kwargs)[source]#
List of authors which have contributed at least to one article.
- class lotus.views.AuthorDetailView(*args, **kwargs)[source]#
Author detail and its related article list.
Opposed to article or category listing, this one list objects for language from request, not from the author language since it dont have one.
- pk_url_kwarg = None#
- class lotus.views.CategoryDetailView(*args, **kwargs)[source]#
Category detail and its related article list.
- pk_url_kwarg = None#
- class lotus.views.DisabledTagIndexView(**kwargs)[source]#
A very basic view which always return the common Http404 page.
- class lotus.views.EnabledTagIndexView(*args, **kwargs)[source]#
List of tags that are related from at least one article.
- model#
alias of
Tag
- class lotus.views.PreviewArticleDetailView(*args, **kwargs)[source]#
TODO: Should force set the context var for preview mode at True without to tamper session so the user session is still in its current state but it can preview.
- class lotus.views.PreviewTogglerView(**kwargs)[source]#
Toggle preview mode in user session.
The redirection url can not be one of the preview toggler url, this is to avoid malicious redirection loop.
Only authenticated admin user is allowed to use this view and an URL argument “next” is required to be given and not relative (not starting with
/
) else it is assumed as a bad operation.
- class lotus.views.TagIndexView(*args, **kwargs)#
This is the effective index class view which inherit either from the working index view or the dummy 404 view if Tag index is enabled or not according to settings.
- class lotus.views.TagDetailView(*args, **kwargs)[source]#
Tag detail and its related article list.
Opposed to article or category listing, this one list objects for language from request, not from the tag language since it dont have one.
- model#
alias of
Tag
- pk_url_kwarg = None#
- class lotus.views.TagAutocompleteView(**kwargs)[source]#
View to return JSON response for a tag list.
Default returns paginated list of all available tags. If request argument
q
is given, the list will return tag items that start with text from argument.Worth to notice this is language agnostic, since a Tag does not have any specific language.
- class lotus.views.admin.ArticleAdminTranslateView(**kwargs)[source]#
Display a form to select a language to translate an article to.
- class lotus.views.admin.CategoryAdminTranslateView(**kwargs)[source]#
Display a form to select a language to translate a category to.
- class lotus.views.admin.CustomLotusAdminContext[source]#
Mixin to add required context for a custom model admin view.
The view which use it must have the
model
correctly set to your model, if your view has no model then this mixin is probably useless.Also, there is an additional useful context variable
title
to set yourself in your view since its value is totally related to the view itself.
- class lotus.views.admin.AdminTranslateView(**kwargs)[source]#
Mixin to display a form to select a language to translate an object to.
The form does not perform a POST request. Instead it will make a GET to the object create form with some URL argument so the create form will know it will have to prefill fields “language” and “original”, the user still have to fill everything else.
Form only displays the language which are still available (not in original and its possible translations).
Given ID is used to retrieve an object and get its original if its translation. Finally the form will always redirect to an original object.
Despite inheriting from DetailView, this is not a ready to use view, you need inherit it to define the
mode
andtemplate_name
attributes correctly.- get_queryset()[source]#
Return the QuerySet that will be used to look up the object.
This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.