loefsys.members.views module

Views for the member profiles.

class loefsys.members.views.UserProfileMixin

Bases: SingleObjectMixin

Mixin to retrieve the current user.

Overrides the get_object method to return the current user.

get_object(_queryset=None)

Retrieve the user from the request.

class loefsys.members.views.ProfileView(**kwargs)

Bases: LoginRequiredMixin, DetailView

View for displaying a user’s profile by slug.

Fetches the user based on the slug field. (user.slug)

context_object_name = 'member'
model

alias of User

template_name = 'profiles/profile.html'
class loefsys.members.views.UserProfileView(**kwargs)

Bases: UserProfileMixin, ProfileView

View for displaying the profile of the logged-in user.

Overrides the get_object method to return the current user.

get_context_data(**kwargs)

Add user information to the context.

class loefsys.members.views.UserProfileEditView(**kwargs)

Bases: UserProfileMixin, UpdateView

View for updating the profile of the logged-in user.

context_object_name = 'member'
model

alias of User

template_name = 'profiles/profile_edit.html'