people package#
Subpackages#
Submodules#
people.admin module#
- class people.admin.PersonAdmin(model, admin_site)#
Bases:
ModelAdmin
people.forms module#
- class people.forms.DetailForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)#
Bases:
ModelForm
- property media#
Return all media required to render the widgets on this form.
- class people.forms.LoginForm(request=None, *args, **kwargs)#
Bases:
AuthenticationForm
The ‘request’ parameter is set for custom auth use by subclasses. The form data comes in via the standard ‘data’ kwarg.
- property media#
Return all media required to render the widgets on this form.
- class people.forms.RegistrationForm(data=None, files=None, auto_id='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, renderer=None)#
Bases:
Form
Form for user registration
- clean()#
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__’.
- clean_username()#
Validate the username (correctness and uniqueness)
- property media#
Return all media required to render the widgets on this form.
- save(request)#
Create the user
- class people.forms.TeamChoiceField(queryset, *, empty_label='---------', required=True, widget=None, label=None, initial=None, help_text='', to_field_name=None, limit_choices_to=None, blank=False, **kwargs)#
Bases:
ModelChoiceField
- label_from_instance(obj)#
Convert objects into strings and generate the labels for the choices presented by this object. Subclasses can override this method to customize the display of the choices.
- class people.forms.TeamJoinForm(*args, **kwargs)#
Bases:
Form
- property media#
Return all media required to render the widgets on this form.
- people.forms.get_image_size(url)#
Returns width and height (as tuple) of the image pointed at by the url Code partially copied from http://effbot.org/zone/pil-image-size.htm
people.models module#
- class people.models.FakePerson#
Bases:
object
A FakePerson is not a real one. Just wraps functions for a user that does not really exist in the database.
- class people.models.MatrixNetworkField(*args, db_collation=None, **kwargs)#
Bases:
CharField
- class people.models.Person(*args, **kwargs)#
Bases:
User
,FakePerson
The User class of D-L.
- exception DoesNotExist#
Bases:
DoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- classmethod clean_obsolete_accounts()#
Remove accounts that: - last login is more than 2 years - is not coordinator - is not module maintainer - has no reserved module
- property forge_account_url: str#
- Raises:
ValueError: when no forge account exist for this user profile
- property forum_account_url: str#
- Raises:
ValueError: when no forum account exist for this user profile
- is_coordinator(team)#
If team is a Team instance, tell if current Person is coordinator of that team. If team = ‘any’, tell if current Person is coordinator of at least one team.
- save(*args, **kwargs)#
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
people.views module#
- class people.views.PeopleListView(**kwargs)#
Bases:
ListView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_context_data(**kwargs)#
Get the context for this view.
- class people.views.PersonDetailView(**kwargs)#
Bases:
DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_context_data(**kwargs)#
Insert the single object into the context dict.
- class people.views.PersonEditView(**kwargs)#
Bases:
UpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- form_class#
alias of
DetailForm
- form_invalid(form)#
If the form is invalid, render the invalid form.
- get_context_data(**kwargs)#
Insert the form into the context dict.
- get_object(**kwargs)#
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.
- people.views.person_password_change(request)#
Handle the generic form to change the password
- people.views.person_team_join(request)#
Handle the form to join a team