Views¶
user-messages has a number of views, the following are the views, the extra arguments they take, the templates they render, and the variables they make available in the context.
- user_messages.views.inbox(request, template_name="user_messages/inbox.html")¶
Display the user’s inbox. The context contains:
- threads: A queryset of the Thread objects in the user’s inbox.
- user_messages.views.thread_detail(request, thread_id, template_name="user_messages/thread_detail.html", form_class=MessageReplyForm)¶
Displays all the messages in an individual thread. Also has a form for posting a new message in the thread. The context contains:
- thread: The Thread object to be displayed.
- form: The form (an instance of form_class) for posting a new reply.
- user_messages.views.message_create(request, user_id=None, template_name="user_messages/message_create.html", form_class=None, multiple=False)¶
Displays a form to and creates a new thread. The context contains:
- form: An instance of form_class for creating a new thread.
- user_messages.views.thread_delete(request, thread_id)¶
Deletes a thread (doesn’t permanently destroy the record of it). This has no template.