Module ImportFrom alias alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias alias alias ImportFrom alias alias alias alias ImportFrom alias Assign NameStore NameLoad ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Assign NameStore NameLoad Assign NameStore Call NameLoad Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Str Assign NameStore NameLoad Assign NameStore Num Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Dict Str Str NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad Return TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call NameLoad NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body TryExcept body Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Pass If BoolOpAnd NameLoad Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call NameLoad BinOpMod Str NameLoad BinOpMod Str TupleLoad NameLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Str NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Str NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Global identifier Assign NameStore Str If CompareIs NameLoad NameLoad body Return NameLoad If CompareNotEq NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryExcept body Assign NameStore Call NameLoad NameLoad keyword ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMod Str TupleLoad Call NameLoad NameLoad handlers ExceptHandler type NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If NameLoad body Expr Call AttributeLoad NameLoad attr BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore NameLoad orelse Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If NameLoad body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore NameLoad orelse Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If NameLoad body Return NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad body Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad orelse Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr NameLoad If CompareIn AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Return Call AttributeLoad NameLoad attr NameLoad BoolOpOr NameLoad Call AttributeLoad NameLoad attr decorator_list NameLoad decorator_list
N/A django.core.urlresolvers reverse NoReverseMatch django.utils.crypto salted_hmac django.utils.translation ugettext _ django.shortcuts redirect django.template.loader render_to_string django.utils.six string_types utils Recipient recipients get_site_url get_registered_messenger_object models Message Dispatch Subscription signals sig_unsubscribe_success sig_unsubscribe_failed sig_mark_read_success sig_mark_read_failed exceptions UnknownMessengerError N/A APP_URLS_ATTACHED None MessageBase N/A object N/A N/A Base class for messages used by sitemessage.
    Customized message handling is available through inheritance.

     N/A supported_messengers N/A N/A alias None N/A title N/A _ Notification N/A priority None N/A has_dynamic_context False N/A template_ext tpl N/A template None N/A send_retry_limit 10 N/A allow_user_subscription True N/A _message_model None N/A _dispatch_models None N/A SIMPLE_TEXT_ID stext_ __init__ N/A N/A self context template_path N/A None None N/A N/A Initializes a message.

        :param dict, str context: data to be used for message rendering (e.g. in templates)
        :param str template_path: template path
         N/A context_base N/A tpl use_tpl None False N/A N/A context None N/A N/A N/A N/A self update_context context_base context template_path template_path N/A N/A self context context_base N/A get_alias N/A N/A cls N/A N/A N/A Returns message type alias.

        :return: str
        :rtype: str
         N/A N/A N/A cls alias None N/A N/A N/A cls alias N/A cls __name__ N/A N/A cls alias N/A classmethod __str__ N/A N/A self N/A N/A N/A N/A N/A N/A self __class__ get_alias N/A get_context N/A N/A self N/A N/A N/A Returns message context.

        :return: dict
        :rtype: dict
         N/A N/A self context N/A schedule N/A N/A self recipients sender priority N/A None None None N/A N/A Schedules message for a delivery.
        Puts message (and dispatches if any) data into DB.

        :param list|None recipients: recipient (or a list) or None.
            If `None` Dispatches should be created before send using `prepare_dispatches()`.
        :param User|None sender: Django User model heir instance
        :param int|None priority: number describing message priority
        :return: a tuple with message model and a list of dispatch models.
        :rtype: tuple
         N/A N/A priority None N/A N/A priority N/A self priority N/A N/A N/A self _message_model N/A self _dispatch_models N/A N/A Message create N/A N/A self get_alias N/A N/A self get_context recipients recipients sender sender priority priority N/A N/A N/A self _message_model N/A self _dispatch_models N/A recipients N/A N/A cls messenger addresses N/A N/A N/A Shorcut method. See `recipients()`, N/A N/A recipients messenger addresses N/A classmethod get_subscribers N/A N/A cls N/A N/A N/A Returns a list of Recipient objects subscribed for this message type.

        :return:
         N/A subscribers_raw N/A N/A Subscription get_for_message_cls N/A cls alias N/A subscribers N/A N/A subscriber subscribers_raw N/A N/A messenger_cls N/A subscriber messenger_cls N/A address N/A subscriber address N/A recipient N/A subscriber recipient N/A N/A address None N/A N/A N/A N/A address N/A N/A N/A get_registered_messenger_object messenger_cls get_address recipient N/A N/A N/A UnknownMessengerError N/A N/A N/A N/A address N/A isinstance address string_types N/A N/A N/A N/A subscribers append N/A Recipient messenger_cls recipient address N/A subscribers N/A classmethod get_dispatch_hash N/A N/A cls dispatch_id message_id N/A N/A N/A Returns a hash string for validation purposes.

        :param int dispatch_id:
        :param int message_id:
        :return:
         N/A N/A N/A N/A salted_hmac N/A %s dispatch_id N/A %s|%s N/A message_id dispatch_id hexdigest N/A classmethod get_mark_read_directive N/A N/A cls message_model dispatch_model N/A N/A N/A Returns mark read directive (command, URL, etc.) string.

        :param Message message_model:
        :param Dispatch dispatch_model:
        :return:
         N/A N/A N/A cls _get_url sitemessage_mark_read message_model dispatch_model N/A classmethod get_unsubscribe_directive N/A N/A cls message_model dispatch_model N/A N/A N/A Returns an unsubscribe directive (command, URL, etc.) string.

        :param Message message_model:
        :param Dispatch dispatch_model:
        :return:
         N/A N/A N/A cls _get_url sitemessage_unsubscribe message_model dispatch_model N/A classmethod _get_url N/A N/A cls name message_model dispatch_model N/A N/A N/A Returns a common pattern sitemessage URL.

        :param str name: URL name
        :param Message message_model:
        :param Dispatch|None dispatch_model:
        :return:
         N/A APP_URLS_ATTACHED N/A url N/A N/A dispatch_model None N/A N/A url N/A N/A APP_URLS_ATTACHED False N/A N/A hashed N/A N/A cls get_dispatch_hash N/A dispatch_model id N/A message_model id N/A N/A N/A url N/A reverse name args N/A N/A message_model id N/A dispatch_model id hashed N/A url N/A %s%s N/A N/A get_site_url url N/A N/A N/A NoReverseMatch N/A N/A N/A APP_URLS_ATTACHED None N/A N/A APP_URLS_ATTACHED False N/A url N/A classmethod handle_unsubscribe_request N/A N/A cls request message dispatch hash_is_valid redirect_to N/A N/A N/A Handles user subscription cancelling request.

        :param Request request: Request instance
        :param Message message: Message model instance
        :param Dispatch dispatch: Dispatch model instance
        :param bool hash_is_valid: Flag indicating that user supplied request signature is correct
        :param str redirect_to: Redirection URL
        :rtype: list
         N/A hash_is_valid N/A N/A N/A N/A Subscription cancel N/A N/A dispatch recipient_id N/A dispatch address N/A cls alias N/A dispatch messenger N/A signal sig_unsubscribe_success N/A N/A signal sig_unsubscribe_failed N/A N/A N/A signal send cls request request message message dispatch dispatch N/A N/A redirect redirect_to N/A classmethod handle_mark_read_request N/A N/A cls request message dispatch hash_is_valid redirect_to N/A N/A N/A Handles a request to mark a message as read.

        :param Request request: Request instance
        :param Message message: Message model instance
        :param Dispatch dispatch: Dispatch model instance
        :param bool hash_is_valid: Flag indicating that user supplied request signature is correct
        :param str redirect_to: Redirection URL
        :rtype: list
         N/A hash_is_valid N/A N/A N/A N/A dispatch mark_read N/A N/A N/A dispatch save N/A signal sig_mark_read_success N/A N/A signal sig_mark_read_failed N/A N/A N/A signal send cls request request message message dispatch dispatch N/A N/A redirect redirect_to N/A classmethod get_template N/A N/A cls message messenger N/A N/A N/A Get a template path to compile a message.

        1. `tpl` field of message context;
        2. `template` field of message class;
        3. deduced from message, messenger data and `template_ext` message type field
           (e.g. `sitemessage/messages/plain__smtp.txt` for `plain` message type).

        :param Message message: Message model
        :param MessengerBase messenger: a MessengerBase heir
        :return: str
        :rtype: str
         N/A template N/A N/A N/A message context get tpl None N/A template N/A N/A template N/A N/A N/A cls template None N/A N/A N/A cls template N/A sitemessage/messages/%s__%s.%s N/A N/A N/A cls get_alias N/A N/A messenger get_alias N/A cls template_ext N/A N/A cls template N/A classmethod compile N/A N/A cls message messenger dispatch N/A None N/A N/A Compiles and returns a message text.

        Considers `use_tpl` field from message context to decide whether
        template compilation is used.

        Otherwise a SIMPLE_TEXT_ID field from message context is used as message contents.

        :param Message message: model instance
        :param MessengerBase messenger: MessengerBase heir instance
        :param Dispatch dispatch: model instance to consider context from
        :return: str
        :rtype: str
         N/A N/A N/A N/A message context get use_tpl False N/A N/A context N/A message context N/A N/A N/A context update N/A SITE_URL directive_unsubscribe directive_mark_read message_model dispatch_model N/A get_site_url N/A N/A cls get_unsubscribe_directive message dispatch N/A N/A cls get_mark_read_directive message dispatch message dispatch N/A context N/A N/A cls get_template_context context N/A N/A render_to_string N/A N/A cls get_template message messenger context N/A N/A N/A message context N/A N/A cls SIMPLE_TEXT_ID N/A classmethod get_template_context N/A N/A cls context N/A N/A N/A Returns context dict for template compilation.

        This method might be reimplemented by a heir to add some data into
        context before template compilation.

        :param dict context: Initial context
        :return:
         N/A context N/A classmethod update_context N/A N/A cls base_context str_or_dict template_path N/A None N/A N/A Helper method to structure initial message context data.

        NOTE: updates `base_context` inplace.

        :param dict base_context: context dict to update
        :param dict, str str_or_dict: text representing a message, or a dict to be placed into message context.
        :param str template_path: template path to be used for message rendering
         N/A N/A isinstance str_or_dict dict N/A N/A N/A N/A base_context update str_or_dict N/A N/A base_context N/A use_tpl True N/A N/A N/A base_context N/A N/A cls SIMPLE_TEXT_ID str_or_dict N/A N/A N/A cls SIMPLE_TEXT_ID str_or_dict N/A N/A N/A base_context N/A use_tpl False N/A N/A base_context N/A tpl template_path N/A classmethod prepare_dispatches N/A N/A cls message recipients N/A None N/A N/A Creates Dispatch models for a given message and return them.

        :param Message message: Message model instance
        :param list|None recipients: A list or Recipient objects
        :return: list of created Dispatch models
        :rtype: list
         N/A N/A N/A Dispatch create message N/A recipients N/A N/A cls get_subscribers N/A classmethod N/A