assembl.models.post module¶
Posts are a kind of assembl.models.generic.Content
that has an author, and reply to some other content.
-
class
assembl.models.post.
IdeaProposalPost
(*args, **kwargs)[source]¶ Bases:
assembl.models.post.WidgetPost
A Post that proposes an Idea.
-
message_id
¶ The email-compatible message-id for the post.
-
-
class
assembl.models.post.
ImportedPost
(*args, **kwargs)[source]¶ Bases:
assembl.models.post.Post
A Post that originated outside of the platform (was imported from elsewhere).
-
body_mime_type
¶ The mime type of the body of the imported content. See Content::get_body_mime_type() for allowed values.
-
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)
-
message_id
¶ The email-compatible message-id for the post.
-
source_post_id
¶ The source-specific unique id of the imported post. A listener keeps the message_id in the post class in sync
-
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.post.
LocalPost
(*args, **kwargs)[source]¶ Bases:
assembl.models.post.Post
A Post that originated directly on the platform (wasn’t imported from elsewhere).
-
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)
-
message_id
¶ The email-compatible message-id for the post.
-
-
class
assembl.models.post.
Post
(*args, **kwargs)[source]¶ Bases:
assembl.models.generic.Content
A Post represents input into the broader discussion taking place on the platform. It may be a response to another post, it may have responses, and its content may be of any type.
-
delete_post
(cause)[source]¶ Set the publication state to a deleted state
Includes an optimization whereby deleted posts without live descendents are tombstoned. Should be resilient to deletion order.
-
filter_idea_content_links_r
(idea_content_links)[source]¶ Exclude positive links if a negative link points from the same idea to the same post or a post below.
Works on dict representations of IdeaContentLink, a version with instances is TODO.
-
indirect_idea_content_links_with_cache
(links_above_post=None, filter=True)[source]¶ Return all ideaContentLinks related to this post or its ancestors
-
indirect_idea_content_links_without_cache
()[source]¶ Return all ideaContentLinks related to this post or its ancestors
-
message_id
¶ The email-compatible message-id for the post.
-
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.post.
SynthesisPost
(*args, **kwargs)[source]¶ Bases:
assembl.models.post.LocalPost
A Post that publishes a synthesis.
-
finalize_publish
()[source]¶ Replace the synthesis with the published version. Call once after creation.
-
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)
-
message_id
¶ The email-compatible message-id for the post.
-
-
class
assembl.models.post.
WidgetPost
(*args, **kwargs)[source]¶ Bases:
assembl.models.post.LocalPost
A Post that comes from an inspiration widget
-
message_id
¶ The email-compatible message-id for the post.
-