Mixins¶
evileg_core.mixins module¶
-
class
evileg_core.mixins.
EActionFormMixin
[source]¶ Bases:
object
-
action_form
¶ alias of
evileg_core.forms.EActionForm
-
actions
= None¶
-
get_action
(action)[source]¶ Return a given action from a parameter, which can either be a callable, or the name of a method on the Mixin. Return is a tuple of (callable, name, description).
-
get_action_choices
(request, default_choices=[('', '---------')])[source]¶ Return a list of choices for use in a form object. Each choice is a tuple (name, description).
-
get_actions
(request)[source]¶ Return a dictionary mapping the names of all actions for this Mixin to a tuple of (callable, name, description) for each action.
-
message_user
(request, message, level=20, extra_tags='', fail_silently=False)[source]¶ Send a message to the user. The default implementation posts a message using the django.contrib.messages backend.
Exposes almost the same API as messages.add_message(), but accepts the positional arguments in a different order to maintain backwards compatibility. For convenience, it accepts the level argument as a string rather than the usual level number.
-
-
class
evileg_core.mixins.
EAjaxableMixin
[source]¶ Bases:
object
Ajaxable mixin for adding ajax methods to view. If method not exists, then try to invoke common method. For example, call get_ajax() for ajax request if this method exists, otherwise call get() method
-
class
evileg_core.mixins.
EInterfaceMixin
[source]¶ Bases:
object
Interface Mixin for representation object in the templates. It is needed to creating a uniform interface in all content objects.
All content objects has several types of representation.
You can override this template in class of content, or globally in the settings.py of your django project.
- Parameters
TEMPLATE_FULL – full template representation
TEMPLATE_PREVIEW – preview template representation
TEMPLATE_INFO – information template representation, commonly it has smaller info than TEMPLATE_PREVIEW
TEMPLATE_MAIL – template representation for rendering this content in mail
-
TEMPLATE_FULL
= 'evileg_core/objects/full.html'¶
-
TEMPLATE_INFO
= 'evileg_core/objects/info.html'¶
-
TEMPLATE_MAIL
= 'evileg_core/objects/mail.html'¶
-
TEMPLATE_PREVIEW
= 'evileg_core/objects/preview.html'¶
-
edit_url_name
= None¶
-
property
parent
¶
-
class
evileg_core.mixins.
EPaginateMixin
[source]¶ Bases:
object
Mixin for adding page pagination functionality into Class Based View. Mixin support get and post requests