assembl.models.discussion module

Definition of the discussion class.

class assembl.models.discussion.Discussion(**kwargs)[source]

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

The context for a specific IdeaLoom discussion.

Most platform entities exist in the scope of a discussion, and inherit from assembl.models.DiscussionBoundBase.

property admin_source

Return the admin source for this discussion. Used by notifications Very naive temporary implementation, to be revised with a proper relationship later

compose_external_uri(*args, **kwargs)[source]

:use_api2 - uses API2 URL path pass as many nodes you want in the args


What is the URL where we expect to find this resource


Get the base URL of this server

Tied to discussion so that we can support virtual hosts or communities in the future and access the urls when we can’t rely on pyramid’s current request (such as when celery generates notifications) Temporarily equivalent to get_global_base_url

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 the ID of an associated discussion object, if any.


alias of assembl.models.user_key_values.DiscussionPerUserNamespacedKeyValue


Reset all notification subscriptions for this discussion


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.

assembl.models.discussion.slugify_topic_if_slug_is_empty(discussion, topic, oldvalue, initiator)[source]

if the target doesn’t have a slug, slugify the topic and use that.