assembl.models.widgets module

Models for widgets, a set of bundled functionality.

In theory, arbitrary widgets could be added to IdeaLoom. In reality, the set of widget behaviours is constrained here.

class assembl.models.widgets.BaseIdeaCollection(name=None)[source]

Bases: assembl.views.traversal.RelationCollectionDefinition

The ‘collection’ of the base_idea of this BaseIdeaWidget

class assembl.models.widgets.BaseIdeaDescendantsCollection(name)[source]

Bases: assembl.views.traversal.AbstractCollectionDefinition

The collection of the descendants of the base_idea of this BaseIdeaWidget

class assembl.models.widgets.BaseIdeaWidget(*args, **kwargs)[source]

Bases: assembl.models.widgets.Widget

A widget attached to a assembl.models.idea.Idea, its base_idea

alias of assembl.models.widgets.BaseIdeaWidgetLink

Bases: assembl.models.widgets.IdeaWidgetLink

class assembl.models.widgets.CreativitySessionWidget(*args, **kwargs)[source]

Bases: assembl.models.widgets.IdeaCreatingWidget

Bases: assembl.models.widgets.IdeaWidgetLink

class assembl.models.widgets.IdeaCreatingWidget(*args, **kwargs)[source]

Bases: assembl.models.widgets.BaseIdeaWidget

A widget where new ideas are created

Bases: assembl.models.widgets.PolymorphicMixinFactory.<locals>.PolymorphicMixin, assembl.models.widgets.BaseIdeaWidgetLink

alias of assembl.models.widgets.PolymorphicMixinFactory.<locals>.PolymorphicMixin

Bases: assembl.models.widgets.PolymorphicMixinFactory.<locals>.PolymorphicMixin, assembl.models.widgets.BaseIdeaWidgetLink

alias of assembl.models.widgets.PolymorphicMixinFactory.<locals>.PolymorphicMixin

Bases: assembl.models.DiscussionBoundBase

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.

populate_from_context(context)[source]

If object created in this context, populate some relations from that context.

This is the magic fallback, ideally define the relationships you want populated explicitly in subclasses of this.

class assembl.models.widgets.InspirationWidget(*args, **kwargs)[source]

Bases: assembl.models.widgets.IdeaCreatingWidget

alias of assembl.models.widgets.IdeaInspireMeWidgetLink

class assembl.models.widgets.MultiCriterionVotingWidget(*args, **kwargs)[source]

Bases: assembl.models.widgets.VotingWidget

assembl.models.widgets.PolymorphicMixinFactory(base_class)[source]

A factory for PolymorphicMixin marker classes

class assembl.models.widgets.TokenVotingWidget(*args, **kwargs)[source]

Bases: assembl.models.widgets.VotingWidget

Bases: assembl.models.widgets.PolymorphicMixinFactory.<locals>.PolymorphicMixin, assembl.models.widgets.IdeaWidgetLink

Bases: assembl.models.widgets.IdeaWidgetLink

Bases: assembl.models.widgets.IdeaWidgetLink

class assembl.models.widgets.VotingWidget(*args, **kwargs)[source]

Bases: assembl.models.widgets.BaseIdeaWidget

class assembl.models.widgets.Widget(*args, **kwargs)[source]

Bases: assembl.models.DiscussionBoundBase

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.

populate_from_context(context)[source]

If object created in this context, populate some relations from that context.

This is the magic fallback, ideally define the relationships you want populated explicitly in subclasses of this.

update_from_json(json, user_id=None, context=None, object_importer=None, permissions=None, parse_def_name='default_reverse')[source]

Update (patch) an object from its JSON representation.

class assembl.models.widgets.WidgetUserConfig(**kwargs)[source]

Bases: assembl.models.DiscussionBoundBase

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.