annotations.display_helpers module¶
-
annotations.display_helpers.
get_appellation_summaries
(appellations)[source]¶ Generate appellation summary information for display in the text detail view.
Parameters: appellations ( django.db.models.query.QuerySet
) –Returns: (list, set) Return type: tuple
-
annotations.display_helpers.
get_recent_annotations
(last=20, user=None)[source]¶ Generate aggregate activity feed for all annotations.
TODO: move this into a util module.
Parameters: - last (int) – Number of items to return (default: 20).
- user (
VogonUser
) –
Returns: Return type: dict
-
annotations.display_helpers.
get_recent_annotations_for_graph
(annotation_by_user, start_date)[source]¶
-
annotations.display_helpers.
get_relations_summaries
(relationset_qs)[source]¶ Organize RelationSets for this text so that we can display them in conjunction with edges in the graph. In other words, grouped by the “source” and “target” of the simplified graphical representation.
Parameters: relationset_qs ( django.db.models.query.QuerySet
) –Returns: Return type: list
-
annotations.display_helpers.
get_snippet
(appellation)[source]¶ Extract the text content surrounding (and including) an
Appellation
instance.Parameters: appellation ( annotations.models.Appellation
) –Returns: snippet – Includes emphasis tags surrounding the Appellation
‘s tokens.Return type: django.utils.safestring.SafeText
-
annotations.display_helpers.
get_snippet_relation
(relationset)[source]¶ Get a text snippet for a
annotations.models.RelationSet
instance.