diesos.users package¶
Subpackages¶
- diesos.users.migrations package
- diesos.users.tests package
- Submodules
- diesos.users.tests.factories module
- diesos.users.tests.test_admin module
- diesos.users.tests.test_drf_urls module
- diesos.users.tests.test_drf_views module
- diesos.users.tests.test_forms module
- diesos.users.tests.test_models module
- diesos.users.tests.test_swagger module
- diesos.users.tests.test_tasks module
- diesos.users.tests.test_urls module
- diesos.users.tests.test_views module
- Module contents
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¶
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- 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:
UserCreationFormForm 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.'}}¶
- 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:
SignupFormForm 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:
SignupFormRenders 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:
AbstractUserDefault 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.commentsis 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.commentsis 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.restaurantis aReverseOneToOneDescriptorinstance.
- 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.childrenis aReverseManyToOneDescriptorinstance.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.childrenis aReverseManyToOneDescriptorinstance.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.childrenis aReverseManyToOneDescriptorinstance.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.childrenis aReverseManyToOneDescriptorinstance.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.childrenis aReverseManyToOneDescriptorinstance.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.toppingsandTopping.pizzasareManyToManyDescriptorinstances.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.childrenis aReverseManyToOneDescriptorinstance.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.childrenis aReverseManyToOneDescriptorinstance.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.commentsis 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.childrenis aReverseManyToOneDescriptorinstance.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.childrenis aReverseManyToOneDescriptorinstance.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.toppingsandTopping.pizzasareManyToManyDescriptorinstances.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- 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.
- 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)¶