askbot.models.base

class askbot.models.base.AnonymousContent(*args, **kwargs)

Bases: django.db.models.base.Model

Base class for AnonymousQuestion and AnonymousAnswer

class Meta
AnonymousContent.author
AnonymousContent.get_next_by_added_at(*moreargs, **morekwargs)
AnonymousContent.get_previous_by_added_at(*moreargs, **morekwargs)
class askbot.models.base.ContentRevision(*args, **kwargs)

Bases: django.db.models.base.Model

Base class for QuestionRevision and AnswerRevision

class Meta
ContentRevision.as_html()

should return html representation of the revision

ContentRevision.author
ContentRevision.get_next_by_revised_at(*moreargs, **morekwargs)
ContentRevision.get_previous_by_revised_at(*moreargs, **morekwargs)
class askbot.models.base.DeletableContent(*args, **kwargs)

Bases: django.db.models.base.Model

class Meta
DeletableContent.deleted_by
class askbot.models.base.MetaContent(*args, **kwargs)

Bases: django.db.models.base.Model

Base class for Vote and Comment

class Meta
MetaContent.content_object

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

MetaContent.content_type
class askbot.models.base.UserContent(*args, **kwargs)

Bases: django.db.models.base.Model

class Meta
UserContent.user
askbot.models.base.parse_and_save_post(post, author=None, **kwargs)

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

askbot.models.base.parse_post_text(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

This Page