eggplant.profiles package¶
Submodules¶
eggplant.profiles.admin module¶
eggplant.profiles.forms module¶
-
class
eggplant.profiles.forms.
NewUserSetPasswordForm
(*args, **kwargs)[source]¶ Bases:
allauth.account.forms.SetPasswordForm
-
base_fields
= OrderedDict([('password1', <allauth.account.forms.SetPasswordField object>), ('password2', <allauth.account.forms.PasswordField object>)])¶
-
declared_fields
= OrderedDict([('password1', <allauth.account.forms.SetPasswordField object>), ('password2', <allauth.account.forms.PasswordField object>)])¶
-
media
¶
-
-
class
eggplant.profiles.forms.
ProfileForm
(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]¶ Bases:
django.forms.forms.Form
-
base_fields
= OrderedDict([('first_name', <django.forms.fields.CharField object>), ('middle_name', <django.forms.fields.CharField object>), ('last_name', <django.forms.fields.CharField object>), ('address', <django.forms.fields.CharField object>), ('city', <django.forms.fields.CharField object>), ('postcode', <django.forms.fields.CharField object>), ('tel', <django.forms.fields.CharField object>), ('sex', <django.forms.fields.ChoiceField object>), ('photo', <django.forms.fields.ImageField object>)])¶
-
declared_fields
= OrderedDict([('first_name', <django.forms.fields.CharField object>), ('middle_name', <django.forms.fields.CharField object>), ('last_name', <django.forms.fields.CharField object>), ('address', <django.forms.fields.CharField object>), ('city', <django.forms.fields.CharField object>), ('postcode', <django.forms.fields.CharField object>), ('tel', <django.forms.fields.CharField object>), ('sex', <django.forms.fields.ChoiceField object>), ('photo', <django.forms.fields.ImageField object>)])¶
-
media
¶
-
-
class
eggplant.profiles.forms.
SignupForm
(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]¶ Bases:
eggplant.profiles.forms.ProfileForm
-
base_fields
= OrderedDict([('first_name', <django.forms.fields.CharField object>), ('middle_name', <django.forms.fields.CharField object>), ('last_name', <django.forms.fields.CharField object>), ('address', <django.forms.fields.CharField object>), ('city', <django.forms.fields.CharField object>), ('postcode', <django.forms.fields.CharField object>), ('tel', <django.forms.fields.CharField object>), ('sex', <django.forms.fields.ChoiceField object>), ('photo', <django.forms.fields.ImageField object>), ('email', <django.forms.fields.EmailField object>), ('password1', <allauth.account.forms.SetPasswordField object>), ('password2', <allauth.account.forms.PasswordField object>)])¶
-
clean_email
()[source]¶ Check if user is already registered and if so raise validation error.
It may be considered a security hole to inform if a user is registered or not but it improves usability.
-
declared_fields
= OrderedDict([('first_name', <django.forms.fields.CharField object>), ('middle_name', <django.forms.fields.CharField object>), ('last_name', <django.forms.fields.CharField object>), ('address', <django.forms.fields.CharField object>), ('city', <django.forms.fields.CharField object>), ('postcode', <django.forms.fields.CharField object>), ('tel', <django.forms.fields.CharField object>), ('sex', <django.forms.fields.ChoiceField object>), ('photo', <django.forms.fields.ImageField object>), ('email', <django.forms.fields.EmailField object>), ('password1', <allauth.account.forms.SetPasswordField object>), ('password2', <allauth.account.forms.PasswordField object>)])¶
-
media
¶
-
eggplant.profiles.middleware module¶
eggplant.profiles.models module¶
-
class
eggplant.profiles.models.
UserProfile
(id, user, middle_name, address, postcode, city, tel, tel2, sex, photo, created, changed)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
FEMALE
= 'female'¶
-
MALE
= 'male'¶
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
OTHER
= 'other'¶
-
SEX_CHOICES
= (('', '-----'), ('female', 'female'), ('male', 'male'), ('other', 'other'))¶
-
accounts
¶ 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.
-
address
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
administrator_for
¶ 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.
-
changed
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
city
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
full_name
¶ Returns member’s full name.
-
get_next_by_changed
(*moreargs, **morekwargs)¶
-
get_next_by_created
(*moreargs, **morekwargs)¶
-
get_previous_by_changed
(*moreargs, **morekwargs)¶
-
get_previous_by_created
(*moreargs, **morekwargs)¶
-
get_sex_display
(*moreargs, **morekwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
classmethod
in_department
(department, only_active_accounts=True)[source]¶ Returns the user profiles linked to the given department via: UserProfile -> Account -> DepartmentMembership -> Department
-
middle_name
¶ 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>¶
-
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.
-
photo
¶ Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
-
postcode
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
sex
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
tel
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
tel2
¶ 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 many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
user_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
userprofilepermission_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.
-
exception
eggplant.profiles.tests module¶
eggplant.profiles.urls module¶
eggplant.profiles.views module¶
-
class
eggplant.profiles.views.
NewUserPassword
(**kwargs)[source]¶ Bases:
eggplant.core.views.LoginRequiredMixin
,allauth.account.views.PasswordSetView
Set password only for a new user. Existing users can use password change.
-
form_class
¶ alias of
NewUserSetPasswordForm
-
success_url
= <django.utils.functional.__proxy__ object>¶
-
-
class
eggplant.profiles.views.
Profile
(**kwargs)[source]¶ Bases:
eggplant.core.views.LoginRequiredMixin
,django.views.generic.edit.FormView
Profile form view.
-
form_class
¶ alias of
ProfileForm
-
success_url
= <django.utils.functional.__proxy__ object>¶
-
template_name
= 'eggplant/profiles/profile_detail.html'¶
-