Class Reference

Decorators

django_webix.utils.decorators.script_login_required(view, login_url=None)[source]

Template Tags

django_webix.templatetags.django_webix_utils.do_if_has_tag(parser, token, negate=False)[source]

The logic for both {% if_has_tag %} and {% if not_has_tag %}. Checks if all the given tags exist (or not exist if negate is True) and then only parses the branch that will not error due to non-existing tags. This means that the following is essentially the same as a {% comment %} tag:: {% if_has_tag non_existing_tag %} {% non_existing_tag %} {% endif_has_tag %} Another example is checking a built-in tag. This will always render the current year and never FAIL:: {% if_has_tag now %} {% now “Y” %} {% else %} FAIL {% endif_has_tag %}

django_webix.templatetags.django_webix_utils.friendly_load(parser, token)[source]

Tries to load a custom template tag set. Non existing tag libraries are ignored. This means that, if used in conjunction with if_has_tag, you can try to load the comments template tag library to enable comments even if the comments framework is not installed. For example:: {% load friendly_loader %} {% friendly_load comments webdesign %} {% if_has_tag render_comment_list %} {% render_comment_list for obj %} {% else %} {% if_has_tag lorem %} {% lorem %} {% endif_has_tag %} {% endif_has_tag %}

django_webix.templatetags.django_webix_utils.get_value_from_dict(dict_data, key)[source]

usage example {{ your_dict|get_value_from_dict:your_key }}

django_webix.templatetags.django_webix_utils.getattr(obj, args)[source]

Try to get an attribute from an object. Example: {% if block|getattr:”editable,True” %} Beware that the default is always a string, if you want this to return False, pass an empty second argument: {% if block|getattr:”editable,” %}

django_webix.templatetags.django_webix_utils.if_has_tag(parser, token)[source]

Do something if all given tags are loaded:: {% load friendly_loader %} {% friendly_load webdesign %} {% if_has_tag lorem %} {% lorem %} {% else %} Non dummy content goes here! {% endif_has_tag %} When given multiple arguments each and every tag in the list has to be available. This means that the following will render nothing:: {% if_has_tag now nonexisting_tag %} {% now “Y” %} % endif_has_tag %}

django_webix.templatetags.django_webix_utils.ifnot_has_tag(parser, token)[source]

Do something unless any given tag is loaded:: {% load friendly_loader %} {% friendly_load comments %} {% ifnot_has_tag render_comment_list %} Comment support has been disabled. {% else %} {% render_comment_list for obj %} {% endifnot_has_tag %} In the case of multiple arguments, the condition will trigger if any tag in the list is unavailable. This means that the following will still render the current year:: {% ifnot_has_tag now nonexisting_tag %} {% now “Y” %} {% endifnot_has_tag %}

Forms

Forms Mixin

Formsets

Views

View Mixins

Utils

Admin Config

Admin Decorators

django_webix.admin_webix.decorators.register(*models, site=None, prefix=None)[source]

Register the given model(s) classes and wrapped ModelWebixAdmin class with admin site: @register(Author) class AuthorAdmin(admin.ModelAdmin): The site kwarg is an admin site to use instead of the default admin site.

Parameters:
  • models
  • site
Returns:

Admin Options

Admin Sites