ecommerce.users package¶
Subpackages¶
- ecommerce.users.migrations package
- ecommerce.users.tests package
- Submodules
- ecommerce.users.tests.factories module
EmailAddressFactory
UserFactory
UserProfileFactory
UserProfileFactory.allow_email_contact
UserProfileFactory.allow_marketing
UserProfileFactory.allow_phone_contact
UserProfileFactory.avatar
UserProfileFactory.birth_date
UserProfileFactory.contact_email
UserProfileFactory.country
UserProfileFactory.full_name
UserProfileFactory.language
UserProfileFactory.phone
UserProfileFactory.website
- ecommerce.users.tests.test_admin module
- ecommerce.users.tests.test_api_urls module
- ecommerce.users.tests.test_api_views module
- ecommerce.users.tests.test_forms module
- ecommerce.users.tests.test_models module
- ecommerce.users.tests.test_swagger module
- Module contents
Submodules¶
ecommerce.users.adapters module¶
- class ecommerce.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 ecommerce.users.adapters.SocialAccountAdapter(request=None)¶
Bases:
DefaultSocialAccountAdapter
ecommerce.users.admin module¶
- class ecommerce.users.admin.UserAdmin(model, admin_site)¶
Bases:
UserAdmin
- add_form¶
alias of
UserAdminCreationForm
- fieldsets = ((None, {'fields': ('username', 'password', 'email')}), ('Profile', {'classes': ('placeholder profile-group',), 'fields': ()}), ('Permissions', {'classes': ('grp-collapse grp-closed',), 'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions')}), ('Important dates', {'fields': ('last_login', 'date_joined')}))¶
- form¶
alias of
UserAdminChangeForm
- get_readonly_fields(request, obj=None)¶
Hook for specifying custom readonly fields.
- inlines = (<class 'ecommerce.users.admin.UserProfileInline'>,)¶
- list_display = ['username', 'is_superuser']¶
- property media¶
- readonly_fields = ['last_login', 'date_joined']¶
- search_fields = ['username']¶
- class ecommerce.users.admin.UserProfileInline(parent_model, admin_site)¶
Bases:
StackedInline
- add_form¶
alias of
UserAdminCreationForm
- can_delete = False¶
- classes = ('grp-collapse grp-open',)¶
- fieldsets = (('Personal Info', {'fields': ('full_name', 'birth_date', 'country', 'language')}), ('Avatar', {'fields': ('avatar',)}), ('Contact Options', {'fields': ('website', 'phone', 'contact_email')}))¶
- form¶
alias of
UserAdminChangeForm
- formfield_overrides = {<class 'django.db.models.fields.files.ImageField'>: {'widget': <class 'ecommerce.utils.admin.CustomAdminFileWidget'>}}¶
- inline_classes = ('grp-collapse grp-open',)¶
- property media¶
- model¶
alias of
UserProfile
ecommerce.users.apps module¶
ecommerce.users.forms module¶
- class ecommerce.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>, '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 ecommerce.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.'}}¶
- 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.
ecommerce.users.models module¶
- class ecommerce.users.models.User(*args, **kwargs)¶
Bases:
AbstractUser
Default custom user model for E-Commerce. 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
- 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 aReverseOneToOneDescriptor
instance.
- 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 aReverseManyToOneDescriptor
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¶
- 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
andTopping.pizzas
areManyToManyDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- password¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- profile¶
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 aReverseOneToOneDescriptor
instance.
- 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
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.
- class ecommerce.users.models.UserProfile(user, full_name, birth_date, avatar, website, phone, contact_email, country, language, allow_email_contact, allow_phone_contact, allow_marketing)¶
Bases:
Model
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- allow_email_contact¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- allow_marketing¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- allow_phone_contact¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- avatar¶
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- birth_date¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- contact_email¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- country¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- full_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_next_by_birth_date(*, field=<django.db.models.fields.DateField: birth_date>, is_next=True, **kwargs)¶
- get_previous_by_birth_date(*, field=<django.db.models.fields.DateField: birth_date>, is_next=False, **kwargs)¶
- language¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- phone¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- user¶
Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
- user_id¶
- website¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.