askbot.models.content

class askbot.models.content.Content(*args, **kwargs)

Bases: django.db.models.base.Model

Base class for Question and Answer

class Meta
Content.add_comment(comment=None, user=None, added_at=None)
Content.author
Content.comments

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

Content.flagged_items

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

Content.get_author_list(include_comments=False, recursive=False, exclude_list=None)
Content.get_comments()
Content.get_instant_notification_subscribers(potential_subscribers=None, mentioned_users=None, exclude_list=None)

get list of users who have subscribed to receive instant notifications for a given post this method works for questions and answers

parameter “potential_subscribers” is not used here, but left for the uniformity of the interface (Comment method does use it)

comment class has it’s own variant which does have quite a bit of duplicated code at the moment

Content.get_latest_revision()
Content.get_latest_revision_number()
Content.get_next_by_added_at(*moreargs, **morekwargs)
Content.get_previous_by_added_at(*moreargs, **morekwargs)
Content.get_text()
Content.get_time_of_last_edit()
Content.last_edited_by
Content.locked_by
Content.passes_tag_filter_for_user(user)
Content.post_get_last_update_info()
Content.votes

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

This Page