Views

MessageListView

userena.contrib.umessages.views.MessageListView(**kwargs)

Returns the message list for this user. This is a list contacts which at the top has the user that the last conversation was with. This is an imitation of the iPhone SMS functionality.

MessageDetailListView

userena.contrib.umessages.views.MessageDetailListView(**kwargs)

Returns a conversation between two users

message_compose

userena.contrib.umessages.views.message_compose(request, recipients=None, compose_form=<class 'userena.contrib.umessages.forms.ComposeForm'>, success_url=None, template_name='umessages/message_form.html', recipient_filter=None, extra_context=None)

Compose a new message

Recipients

String containing the usernames to whom the message is send to. Can be multiple username by seperating them with a + sign.

Parameters
  • compose_form – The form that is used for getting neccesary information. Defaults to ComposeForm.

  • success_url – String containing the named url which to redirect to after successfull sending a message. Defaults to userena_umessages_list if there are multiple recipients. If there is only one recipient, will redirect to userena_umessages_detail page, showing the conversation.

  • template_name – String containing the name of the template that is used.

  • recipient_filter – A list of User that don”t want to receive any messages.

  • extra_context – Dictionary with extra variables supplied to the template.

Context

form

The form that is used.

message_remove

userena.contrib.umessages.views.message_remove(request, undo=False)

A POST to remove messages.

Parameters

undo – A Boolean that if True unremoves messages.

POST can have the following keys:

message_pks

List of message id’s that should be deleted.

next

String containing the URI which to redirect to after the keys are removed. Redirect defaults to the inbox view.

The next value can also be supplied in the URI with ?next=<value>.