assembl.models.generic module¶
The basic Content and ContentSource classes.
-
class
assembl.models.generic.
AnnotatorSource
(**kwargs)[source]¶ Bases:
assembl.models.generic.ContentSource
A source of content coming from annotator
-
class
assembl.models.generic.
Content
(*args, **kwargs)[source]¶ Bases:
assembl.lib.history_mixin.TombstonableOriginMixin
,assembl.models.DiscussionBoundBase
Content is a polymorphic class to describe what is imported from a Source. The body and subject properly belong to the Post but were moved here to optimize the most common case.
-
classmethod
best_locale_query
(locales)[source]¶ BUGGY. Return a query that will load the post, best subject and best body for the given locales
-
get_body_mime_type
()[source]¶ Return the format of the body, so the frontend will know how to display it. Currently, only: text/plain (Understood as preformatted text) text/html (Undestood as some subset of html)
-
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.
-
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.
-
classmethod
-
class
assembl.models.generic.
ContentSource
(**kwargs)[source]¶ Bases:
assembl.models.DiscussionBoundBase
,assembl.lib.history_mixin.OriginMixin
A ContentSource is where any outside content comes from. .
-
class
assembl.models.generic.
ContentSourceIDs
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
A table that keeps track of the number of external identities that an internal post can be exported to.
A stepping-stone to having Sinks
-
class
assembl.models.generic.
PostSource
(**kwargs)[source]¶ Bases:
assembl.models.generic.ContentSource
A Discussion PostSource is where commentary that is handled in the form of internal posts comes from.
A discussion source should have a method for importing all content, as well as only importing new content. Maybe the standard interface for this should be source.import().