askbot.models.meta

class askbot.models.meta.Comment(*args, **kwargs)

Bases: askbot.models.base.MetaContent, askbot.models.base.UserContent

Comment(id, user_id, content_type_id, object_id, comment, added_at, html)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Comment.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Comment.content_object

Provides a generic relation to any object through content-type/object-id fields.

Comment.content_type
Comment.delete(**kwargs)

deletes comment and concomitant response activity records, as well as mention records, while preserving integrity or response counts for the users

Comment.get_absolute_url(*moreargs, **morekwargs)
Comment.get_instant_notification_subscribers(potential_subscribers=None, mentioned_users=None, exclude_list=None)

get list of users who want instant notifications about this post

argument potential_subscribers is required as it saves on db hits

Comment.get_latest_revision_number()
Comment.get_next_by_added_at(*moreargs, **morekwargs)
Comment.get_origin_post()
Comment.get_previous_by_added_at(*moreargs, **morekwargs)
Comment.get_response_receivers(exclude_list=None)

get list of users who authored comments on a post and the post itself

Comment.get_text()
Comment.get_time_of_last_edit()
Comment.get_updated_activity_data(created=False)
Comment.parse(post)

typically post has a field to store raw source text in comment it is called .comment, in Question and Answer it is called .text also there is another field called .html (consistent across models) so the goal of this function is to render raw text into .html and extract any metadata given stored in source (currently this metadata is limited by twitter style @mentions but there may be more in the future

function returns a dictionary with the following keys html newly_mentioned_users - list of <User> objects removed_mentions - list of mention <Activity> objects - for removed ones

Comment.parse_and_save(post, author=None, **kwargs)

generic method to use with posts to be used prior to saving post edit or addition

Comment.set_text(text)
Comment.user
class askbot.models.meta.FlaggedItem(*args, **kwargs)

Bases: askbot.models.base.MetaContent, askbot.models.base.UserContent

A flag on a Question or Answer indicating offensive content.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FlaggedItem.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FlaggedItem.content_object

Provides a generic relation to any object through content-type/object-id fields.

FlaggedItem.content_type
FlaggedItem.get_next_by_flagged_at(*moreargs, **morekwargs)
FlaggedItem.get_previous_by_flagged_at(*moreargs, **morekwargs)
FlaggedItem.user
class askbot.models.meta.FlaggedItemManager

Bases: django.db.models.manager.Manager

get_flagged_items_count_today(user)
class askbot.models.meta.Vote(*args, **kwargs)

Bases: askbot.models.base.MetaContent, askbot.models.base.UserContent

Vote(id, user_id, content_type_id, object_id, vote, voted_at)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Vote.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Vote.content_object

Provides a generic relation to any object through content-type/object-id fields.

Vote.content_type
Vote.get_next_by_voted_at(*moreargs, **morekwargs)
Vote.get_previous_by_voted_at(*moreargs, **morekwargs)
Vote.get_vote_display(*moreargs, **morekwargs)
Vote.is_downvote()
Vote.is_opposite(vote_type)
Vote.is_upvote()
Vote.user
class askbot.models.meta.VoteManager

Bases: django.db.models.manager.Manager

get_down_vote_count_from_user(user)
get_up_vote_count_from_user(user)
get_votes_count_today_from_user(user)

This Page