shuup.admin.modules.users.views package
Submodules
shuup.admin.modules.users.views.detail module
- class shuup.admin.modules.users.views.detail.BaseUserForm(*args, **kwargs)[source]
Bases:
ModelForm
- class Meta[source]
Bases:
object
- fields = ['username', 'email', 'first_name', 'last_name', 'is_staff', 'is_superuser']
- clean()[source]
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- save(commit=True)[source]
Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.
- base_fields = {'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'is_staff': <django.forms.fields.BooleanField object>, 'is_superuser': <django.forms.fields.BooleanField object>, 'last_name': <django.forms.fields.CharField object>, 'password': <django.forms.fields.CharField object>, 'permission_groups': <django.forms.fields.CharField object>, 'permission_info': <django.forms.fields.CharField object>, 'username': <django.forms.fields.CharField object>}
- declared_fields = {'password': <django.forms.fields.CharField object>, 'permission_groups': <django.forms.fields.CharField object>, 'permission_info': <django.forms.fields.CharField object>}
- property media
Return all media required to render the widgets on this form.
- class shuup.admin.modules.users.views.detail.UserDetailView(**kwargs)[source]
Bases:
CreateOrUpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- template_name = 'shuup/admin/users/detail.jinja'
- context_object_name = 'user'
- property fields
- get_queryset()[source]
Return the
QuerySet
that will be used to look up the object.This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- class shuup.admin.modules.users.views.detail.LoginAsUserView(**kwargs)[source]
Bases:
DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- can_impersonate_staff = False
- permission_str = 'user.login-as'
- class shuup.admin.modules.users.views.detail.LoginAsStaffUserView(**kwargs)[source]
Bases:
LoginAsUserView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- can_impersonate_staff = True
- permission_str = 'user.login-as-staff'
shuup.admin.modules.users.views.list module
- class shuup.admin.modules.users.views.list.UserListView[source]
Bases:
PicotableListView
- model = 'auth.User'
- default_columns = [<Column: Username> username, <Column: Email> email, <Column: First Name> first_name, <Column: Last Name> last_name, <Column: Active> is_active, <Column: Groups> groups, <Column: Access to Admin Panel> is_staff]
- get_queryset()[source]
Return the list of items for this view.
The return value must be an iterable and may be an instance of
QuerySet
in which caseQuerySet
specific behavior will be enabled.
- get_object_abstract(instance, item)[source]
Get the object abstract lines (used for mobile layouts) for this object.
Supported keys in abstract line dicts are:
text (required)
title
class (CSS class name –
header
for instance)raw (boolean; whether or not the
text
is raw HTML)
- Parameters:
instance – The instance.
item – The item dict so far. Useful for reusing precalculated values.
- Returns:
Iterable of dicts to pass through to the picotable javascript.
- Return type:
Iterable[dict]
shuup.admin.modules.users.views.password module
- class shuup.admin.modules.users.views.password.PasswordChangeForm(changing_user, target_user, *args, **kwargs)[source]
Bases:
Form
- error_messages = {'password_incorrect': 'Your old password was entered incorrectly. Please enter it again.', 'password_mismatch': "The two password fields didn't match."}
- base_fields = {'old_password': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>}
- declared_fields = {'old_password': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>}
- property media
Return all media required to render the widgets on this form.
- class shuup.admin.modules.users.views.password.UserChangePasswordView(**kwargs)[source]
Bases:
UpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- form_class
alias of
PasswordChangeForm
- template_name = 'shuup/admin/users/change_password.jinja'
- model = 'auth.User'
- title = 'Change User Password'
- class shuup.admin.modules.users.views.password.UserResetPasswordView(**kwargs)[source]
Bases:
DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- model = 'auth.User'
- template_name = 'shuup/admin/users/reset_password.jinja'
- title = 'Reset User Password'
shuup.admin.modules.users.views.permissions module
- class shuup.admin.modules.users.views.permissions.PermissionChangeFormBase(changing_user, *args, **kwargs)[source]
Bases:
ModelForm
- clean()[source]
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- save()[source]
Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.
- base_fields = {'old_password': <django.forms.fields.CharField object>}
- declared_fields = {'old_password': <django.forms.fields.CharField object>}
- property media
Return all media required to render the widgets on this form.
- class shuup.admin.modules.users.views.permissions.UserChangePermissionsView(**kwargs)[source]
Bases:
UpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- template_name = 'shuup/admin/users/change_permissions.jinja'
- model = 'auth.User'
- title = 'Change User Permissions'
Module contents
- class shuup.admin.modules.users.views.UserListView[source]
Bases:
PicotableListView
- default_columns = [<Column: Username> username, <Column: Email> email, <Column: First Name> first_name, <Column: Last Name> last_name, <Column: Active> is_active, <Column: Groups> groups, <Column: Access to Admin Panel> is_staff]
- get_object_abstract(instance, item)[source]
Get the object abstract lines (used for mobile layouts) for this object.
Supported keys in abstract line dicts are:
text (required)
title
class (CSS class name –
header
for instance)raw (boolean; whether or not the
text
is raw HTML)
- Parameters:
instance – The instance.
item – The item dict so far. Useful for reusing precalculated values.
- Returns:
Iterable of dicts to pass through to the picotable javascript.
- Return type:
Iterable[dict]
- get_queryset()[source]
Return the list of items for this view.
The return value must be an iterable and may be an instance of
QuerySet
in which caseQuerySet
specific behavior will be enabled.
- model = 'auth.User'
- class shuup.admin.modules.users.views.UserDetailView(**kwargs)[source]
Bases:
CreateOrUpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- context_object_name = 'user'
- property fields
- get_queryset()[source]
Return the
QuerySet
that will be used to look up the object.This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- post(request, *args, **kwargs)[source]
Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.
- template_name = 'shuup/admin/users/detail.jinja'
- class shuup.admin.modules.users.views.UserChangePasswordView(**kwargs)[source]
Bases:
UpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- form_class
alias of
PasswordChangeForm
- get_queryset()[source]
Return the
QuerySet
that will be used to look up the object.This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- model = 'auth.User'
- template_name = 'shuup/admin/users/change_password.jinja'
- title = 'Change User Password'
- class shuup.admin.modules.users.views.UserResetPasswordView(**kwargs)[source]
Bases:
DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_queryset()[source]
Return the
QuerySet
that will be used to look up the object.This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- model = 'auth.User'
- template_name = 'shuup/admin/users/reset_password.jinja'
- title = 'Reset User Password'
- class shuup.admin.modules.users.views.UserChangePermissionsView(**kwargs)[source]
Bases:
UpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_queryset()[source]
Return the
QuerySet
that will be used to look up the object.This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- model = 'auth.User'
- template_name = 'shuup/admin/users/change_permissions.jinja'
- title = 'Change User Permissions'
- class shuup.admin.modules.users.views.LoginAsUserView(**kwargs)[source]
Bases:
DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- can_impersonate_staff = False
- permission_str = 'user.login-as'
- class shuup.admin.modules.users.views.LoginAsStaffUserView(**kwargs)[source]
Bases:
LoginAsUserView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- can_impersonate_staff = True
- permission_str = 'user.login-as-staff'