circuit
circuit social network code-documentation
Classes | Functions
users.views Namespace Reference

Classes

class  UserCreateView
 
class  UserDeleteView
 
class  UserFavoriteView
 
class  UserProfileView
 
class  UserUpdateView
 

Functions

def user_request_reset_password (request)
 
def user_reset_password (request, token)
 
def user_create_confirm (request, token)
 
def user_login (request)
 
def user_logout (request)
 
def user_profile_by_username (request, username)
 
def user_password (request)
 
def user_search (request)
 
def email_notification_for_user
 
def set_notifications_attribute (context_user)
 
def send_notifications
 
def see_nofitication (request, kwargs)
 
def mark_all_as_read (request)
 
def show_all_notifications (request)
 

Detailed Description

@package users
Users views file.

@author 7Pros
@copyright

Function Documentation

def users.views.email_notification_for_user (   user,
  subject,
  templateFile,
  context = {} 
)
function for notification via email for users:
site-url is set as the link to the main page of the circuit
and is available in the templates as well as the user and the values given
in the dictionary "context"
the template file should contain the explicit path to the template beginning in the templates folder of users
def users.views.mark_all_as_read (   request)
Set all the notifications as read.

@param request: the incoming request data.

@return: returns to the referer page with all the notifications set as read.
def users.views.see_nofitication (   request,
  kwargs 
)
Sets the notification as viewed. If it's a post-related notifications, returns a view to the post, otherwise just returns to the referer page.

@param request: incoming request data.
@param kwargs: sent keyword arguments with the request.

@return: redirects to the post or to the referer.
def users.views.send_notifications (   user,
  email_subject,
  email_template,
  context,
  post = None 
)
Sends the email and the real-time notifications to the users.

@param user: the user that will get the notification.
@param email_subject: the email's subject.
@param email_template: the email's template.
@param context: the contents of the notification.
@param post: In case it is a post-related notification will be a post instance.
def users.views.set_notifications_attribute (   context_user)
Set all notifications to the user.

@param context_user: the user to which the notifications will be added
def users.views.show_all_notifications (   request)
Returns the rendered view of the user's notifications panel.

@param request: the incoming request.

@return: the rendered template.
def users.views.user_create_confirm (   request,
  token 
)
def users.views.user_login (   request)
def users.views.user_logout (   request)
def users.views.user_password (   request)
Change a user's password.

@param request: the request to handle
@return redirect to the user's profile edit page if allowed,
        raises Http404 if not allowed to change the password
def users.views.user_profile_by_username (   request,
  username 
)
Renders the view of a profile that was searched by username

@param request: HttpRequestObj - current request.
@param username: string - searched username

@return rendered template with the given context
def users.views.user_request_reset_password (   request)
def users.views.user_reset_password (   request,
  token 
)
def users.views.user_search (   request)