assembl.models.idea_graph_view module

Subsets of assembl.models.idea.Idea and assembl.models.idea.IdeaLink.

class assembl.models.idea_graph_view.ExplicitSubGraphView(**kwargs)[source]

Bases: assembl.models.idea_graph_view.IdeaGraphView

A view where the Ideas and/or ideaLinks have been explicitly selected.

Note that ideaLinks may point to ideas that are not in the graph. They should be followed transitively (if their nature is compatible) to reach every idea in graph as if they were directly linked.

class assembl.models.idea_graph_view.IdeaGraphView(**kwargs)[source]

Bases: assembl.models.DiscussionBoundBase, assembl.lib.history_mixin.OriginMixin

A view on the graph of idea.

classmethod get_discussion_conditions(discussion_id, alias_maker=None)[source]

Returns a list of SQLA expressions that constrain a query on this class to a given discussion.

get_discussion_id()[source]

Get the ID of an associated discussion object, if any.

class assembl.models.idea_graph_view.SubGraphIdeaAssociation(**kwargs)[source]

Bases: assembl.models.DiscussionBoundBase

Association table saying that an Idea is part of a ExplicitSubGraphView

classmethod get_discussion_conditions(discussion_id, alias_maker=None)[source]

Returns a list of SQLA expressions that constrain a query on this class to a given discussion.

get_discussion_id()[source]

Get the ID of an associated discussion object, if any.

classmethod special_quad_patterns(alias_maker, discussion_id)[source]

Returns a list of quad map patterns for RDF mapping, beyond those defined by introspection.

Important: If defined somewhere, override in subclasses to avoid inheritance.

unique_query()[source]

returns a couple (query, usable), with a sqla query for conflicting similar objects. usable is true if the query has to be enforced; sometimes it makes sense to return un-usable query that will be used to construct queries of subclasses. Note that when a duplicate is found, you’ll often want to expunge the original.

class assembl.models.idea_graph_view.SubGraphIdeaLinkAssociation(**kwargs)[source]

Bases: assembl.models.DiscussionBoundBase

Association table saying that an IdeaLink is part of a ExplicitSubGraphView

classmethod get_discussion_conditions(discussion_id, alias_maker=None)[source]

Returns a list of SQLA expressions that constrain a query on this class to a given discussion.

get_discussion_id()[source]

Get the ID of an associated discussion object, if any.

classmethod special_quad_patterns(alias_maker, discussion_id)[source]

Returns a list of quad map patterns for RDF mapping, beyond those defined by introspection.

Important: If defined somewhere, override in subclasses to avoid inheritance.

unique_query()[source]

returns a couple (query, usable), with a sqla query for conflicting similar objects. usable is true if the query has to be enforced; sometimes it makes sense to return un-usable query that will be used to construct queries of subclasses. Note that when a duplicate is found, you’ll often want to expunge the original.

class assembl.models.idea_graph_view.Synthesis(**kwargs)[source]

Bases: assembl.models.idea_graph_view.ExplicitSubGraphView

A synthesis of the discussion. A selection of ideas, associated with comments, sent periodically to the discussion.

A synthesis only has link’s to ideas before publication (as it is edited) Once published, if freezes the links by copying tombstoned versions of each link in the discussion.

classmethod get_discussion_conditions(discussion_id, alias_maker=None)[source]

Returns a list of SQLA expressions that constrain a query on this class to a given discussion.

get_discussion_id()[source]

Get the ID of an associated discussion object, if any.

publish()[source]

Publication is the end of a synthesis’s lifecycle. It creates and returns a frozen copy of its state using tombstones for ideas and links.

class assembl.models.idea_graph_view.SynthesisHtmlizationVisitor(graph_view, jinja_env, lang_prefs)[source]

Bases: assembl.models.idea.IdeaVisitor

class assembl.models.idea_graph_view.TableOfContents(**kwargs)[source]

Bases: assembl.models.idea_graph_view.IdeaGraphView

Represents a Table of Ideas.

A ToI in IdeaLoom is used to organize the core ideas of a discussion in a threaded hierarchy.

classmethod get_discussion_conditions(discussion_id, alias_maker=None)[source]

Returns a list of SQLA expressions that constrain a query on this class to a given discussion.

get_discussion_id()[source]

Get the ID of an associated discussion object, if any.

class assembl.models.idea_graph_view.defaultdictlist[source]

Bases: collections.defaultdict