Previous topic

5.13. navigate — Tools to generate navigation’s graph

Next topic

5.15. references — module to generate a new reference

This Page

Languages

Previous versions

1.2
1.1

5.14. plmapp_tags — Template tags and filters used by openPLM

plmapp.templatetags.plmapp_tags.can_add(obj, arg)[source]

Test if an object can be linked to the current object.

Parameters:
  • obj (it can be an instance of DocumentFile, Part or UserController) – object to test
  • arg – arguments here are the current object and the action for link creation
Returns:

True if the action can be processed on the current object

plmapp.templatetags.plmapp_tags.can_add_type(parent_type, child_type)[source]

Used in Bom View.

Parameters:
  • parent_type – Type of the parent, the current part
  • child_type – type of the object that may be added as child
Returns:

True if child_type is a type of object that can be added to parent_type

Used in Doc-Parts views.

Parameters:
  • current_type – type of the current object (part or document)
  • suggested_type – type of the object that may be attached to the current one
Returns:

True if current_type is a type of object that can be attached to current_type object

plmapp.templatetags.plmapp_tags.key(d, key_name)[source]
plmapp.templatetags.plmapp_tags.indice(l, index)[source]
plmapp.templatetags.plmapp_tags.attr(o, attr_name)[source]
plmapp.templatetags.plmapp_tags.plainattr(obj, attr_name)[source]
plmapp.templatetags.plmapp_tags.is_plmobject(result)[source]

Returns True if the object behind result is an instance of PLMObject

plmapp.templatetags.plmapp_tags.is_documentfile(result)[source]

Returns True if the object behind result is an instance of DocumentFile

plmapp.templatetags.plmapp_tags.get_state_class(plmobject)[source]

Returns the state class (“cancelled”, “draft”, “proposed”, “official”, or “deprecated”) of plmobject.

Note

The result of this function is cached with _cache_lifecycle_stuff().

plmapp.templatetags.plmapp_tags.result_class(result)[source]

Returns a css class according to result.

plmapp.templatetags.plmapp_tags.hide_emails(text)[source]

Returns text with all emails removed.

class plmapp.templatetags.plmapp_tags.AddGetParameter(values, variables)[source]
render(context)[source]
plmapp.templatetags.plmapp_tags.add_get(parser, token)[source]
class plmapp.templatetags.plmapp_tags.AddSearchParameter(values)[source]
render(context)[source]
plmapp.templatetags.plmapp_tags.show_pages_bar(page, request)[source]
class plmapp.templatetags.plmapp_tags.IsObjectReadableNode[source]
render(context)[source]
plmapp.templatetags.plmapp_tags.do_is_object_readable(parser, token)[source]
plmapp.templatetags.plmapp_tags.is_readable(obj, user)[source]
plmapp.templatetags.plmapp_tags.main_type(obj)[source]
plmapp.templatetags.plmapp_tags.confirm(context, action, action_label, msg, btn_classes='')[source]
plmapp.templatetags.plmapp_tags.richtext_filter(content, obj=None)[source]

This template filter takes a string value and passes it through the function specified by the RICHTEXT_FILTER setting.

plmapp.templatetags.plmapp_tags.plaintext_filter(content, obj=None)[source]

This template filter takes a string value and passes it through the function specified by the RICHTEXT_PLAIN_FILTER setting.

plmapp.templatetags.plmapp_tags.avatar_url(user)[source]
plmapp.templatetags.plmapp_tags.normalize_language_code(code)[source]
plmapp.templatetags.plmapp_tags.fix_rendered_result(rendered_text)[source]