diesos.users package

Subpackages

Submodules

diesos.users.adapters module

class diesos.users.adapters.AccountAdapter(request=None)

Bases: DefaultAccountAdapter

is_open_for_signup(request: HttpRequest)

Checks whether or not the site is open for signups.

Next to simply returning True/False you can also intervene the regular flow by raising an ImmediateHttpResponse

class diesos.users.adapters.SocialAccountAdapter(request=None)

Bases: DefaultSocialAccountAdapter

is_open_for_signup(request: HttpRequest, sociallogin: Any)

Checks whether or not the site is open for signups.

Next to simply returning True/False you can also intervene the regular flow by raising an ImmediateHttpResponse

diesos.users.admin module

class diesos.users.admin.UserAdmin(model, admin_site)

Bases: UserAdmin

add_form

alias of UserAdminCreationForm

fieldsets = ((None, {'fields': ('username', 'password')}), ('Personal info', {'fields': ('name', 'email')}), ('Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions')}), ('Important dates', {'fields': ('last_login', 'date_joined')}))
form

alias of UserAdminChangeForm

list_display = ['username', 'name', 'is_superuser']
property media
search_fields = ['name']

diesos.users.apps module

class diesos.users.apps.UsersConfig(app_name, app_module)

Bases: AppConfig

name = 'diesos.users'
ready()

Override this method in subclasses to run code when Django starts.

verbose_name = 'Users'

diesos.users.context_processors module

diesos.users.context_processors.allauth_settings(request)

Expose some settings from django-allauth in templates.

diesos.users.forms module

class diesos.users.forms.UserAdminChangeForm(*args, **kwargs)

Bases: UserChangeForm

class Meta

Bases: Meta

model

alias of User

base_fields = {'date_joined': <django.forms.fields.DateTimeField object>, 'email': <django.forms.fields.EmailField object>, 'groups': <django.forms.models.ModelMultipleChoiceField object>, 'is_active': <django.forms.fields.BooleanField object>, 'is_staff': <django.forms.fields.BooleanField object>, 'is_superuser': <django.forms.fields.BooleanField object>, 'last_login': <django.forms.fields.DateTimeField object>, 'name': <django.forms.fields.CharField object>, 'password': <django.contrib.auth.forms.ReadOnlyPasswordHashField object>, 'user_permissions': <django.forms.models.ModelMultipleChoiceField object>, 'username': <django.contrib.auth.forms.UsernameField object>}
declared_fields = {'password': <django.contrib.auth.forms.ReadOnlyPasswordHashField object>}
property media

Return all media required to render the widgets on this form.

class diesos.users.forms.UserAdminCreationForm(*args, **kwargs)

Bases: UserCreationForm

Form for User Creation in the Admin Area. To change user signup, see UserSignupForm and UserSocialSignupForm.

class Meta

Bases: Meta

error_messages = {'username': {'unique': 'This username has already been taken.'}}
model

alias of User

base_fields = {'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}
declared_fields = {'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 diesos.users.forms.UserSignupForm(*args, **kwargs)

Bases: SignupForm

Form that will be rendered on a user sign up section/screen. Default fields will be added automatically. Check UserSocialSignupForm for accounts created from social.

base_fields = {'email': <django.forms.fields.EmailField object>, 'username': <django.forms.fields.CharField object>}
declared_fields = {'email': <django.forms.fields.EmailField object>, 'username': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

class diesos.users.forms.UserSocialSignupForm(*args, **kwargs)

Bases: SignupForm

Renders the form when user has signed up using social accounts. Default fields will be added automatically. See UserSignupForm otherwise.

base_fields = {'email': <django.forms.fields.EmailField object>, 'username': <django.forms.fields.CharField object>}
declared_fields = {'email': <django.forms.fields.EmailField object>, 'username': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

diesos.users.models module

class diesos.users.models.User(*args, **kwargs)

Bases: AbstractUser

Default custom user model for Diesos. If adding fields that need to be filled at user signup, check forms.SignupForm and forms.SocialSignupForms accordingly.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

action_object_actions

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

actor_actions

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

auth_token

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

damage_assessments_added

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

damage_assessments_removed

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

date_joined

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

emailaddress_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

existingcollection_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

first_name = None
follow_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_absolute_url()

Get url for user’s detail view.

Returns:

URL for user detail.

Return type:

str

get_next_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=True, **kwargs)
get_previous_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=False, **kwargs)
groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_active

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_staff

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_superuser

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_login

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_name = None
logentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

First and last name do not cover name patterns around the globe

password

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

socialaccount_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

target_actions

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

treatment_type_added

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

treatment_type_removed

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

user_permissions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

username

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

diesos.users.tasks module

diesos.users.urls module

diesos.users.views module

class diesos.users.views.UserDetailView(**kwargs)

Bases: LoginRequiredMixin, DetailView

model

alias of User

slug_field = 'username'
slug_url_kwarg = 'username'
class diesos.users.views.UserRedirectView(**kwargs)

Bases: LoginRequiredMixin, RedirectView

get_redirect_url()

Return the URL redirect to. Keyword arguments from the URL pattern match generating the redirect request are provided as kwargs to this method.

permanent = False
class diesos.users.views.UserUpdateView(**kwargs)

Bases: LoginRequiredMixin, SuccessMessageMixin, UpdateView

fields = ['name']
get_object()

Return the object the view is displaying.

Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.

get_success_url()

Return the URL to redirect to after processing a valid form.

model

alias of User

success_message = 'Information successfully updated'
diesos.users.views.user_detail_view(request, *args, **kwargs)
diesos.users.views.user_redirect_view(request, *args, **kwargs)
diesos.users.views.user_update_view(request, *args, **kwargs)

Module contents