members.models package

Submodules

members.models.email_change module

class members.models.email_change.EmailChange(id, created_at, member, email, verify_key, confirm_key, verified, confirmed)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

property completed
confirm_key

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

confirmed

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

created_at

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.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
id

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

member

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

member_id
objects = <django.db.models.manager.Manager object>
verified

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

verify_key

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

members.models.member module

class members.models.member.ActiveMemberManager(*args, **kwargs)[source]

Bases: members.models.member.MemberManager

Get all active members, i.e. who have a committee membership

get_queryset()[source]

Select all committee members

class members.models.member.CurrentMemberManager(*args, **kwargs)[source]

Bases: members.models.member.MemberManager

Get all members with an active membership

get_queryset()[source]

Select all members who have a current membership

with_birthdays_in_range(from_date, to_date)[source]

Select all who are currently a Thalia member and have a birthday within the specified range

Parameters
  • from_date (datetime) – the start of the range (inclusive)

  • to_date (datetime) – the end of the range (inclusive)

Returns

the filtered queryset

Return type

Queryset

class members.models.member.Member(id, password, last_login, is_superuser, username, first_name, last_name, email, is_staff, is_active, date_joined)[source]

Bases: django.contrib.auth.models.User

exception DoesNotExist

Bases: django.contrib.auth.models.User.DoesNotExist

exception MultipleObjectsReturned

Bases: django.contrib.auth.models.User.MultipleObjectsReturned

active_members = <members.models.member.ActiveMemberManager object>
classmethod all_with_membership(membership_type)[source]

Get all users who have a specific membership.

Parameters

membership_type – The membership to select by

Returns

List of users

Return type

[Member]

property can_attend_events

May this user attend events

current_members = <members.models.member.CurrentMemberManager object>
property current_membership

The currently active membership of the user. None if not active.

Returns

the currently active membership or None

Return type

Membership or None

property earliest_membership

Get the earliest membership of this user

get_absolute_url()[source]
get_member_groups()[source]

Get the groups this user is a member of

has_active_membership()[source]

Is this member currently active

Tested by checking if the expiration date has passed.

has_been_honorary_member()[source]

Has this user ever been an honorary member?

has_been_member()[source]

Has this user ever been a member?

property latest_membership

Get the most recent membership of this user

mailinglist_set

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.

membergroup_set

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.

objects = <members.models.member.MemberManager object>
property tpay_enabled

Does this user have a bank account with Direct Debit enabled

class members.models.member.MemberManager(*args, **kwargs)[source]

Bases: django.contrib.auth.models.UserManager

Get all members, i.e. all users with a profile.

get_queryset()[source]

Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.

members.models.membership module

class members.models.membership.Membership(id, type, user, since, until)[source]

Bases: django.db.models.base.Model

BENEFACTOR = 'benefactor'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

HONORARY = 'honorary'
MEMBER = 'member'
MEMBERSHIP_TYPES = (('member', 'Member'), ('benefactor', 'Benefactor'), ('honorary', 'Honorary Member'))
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

entry

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.

get_next_by_since(*, field=<django.db.models.fields.DateField: since>, is_next=True, **kwargs)
get_previous_by_since(*, field=<django.db.models.fields.DateField: since>, is_next=False, **kwargs)
get_type_display(*, field=<django.db.models.fields.CharField: type>)
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()[source]
objects = <django.db.models.manager.Manager object>
since

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

type

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

until

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 (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

user_id

members.models.profile module

class members.models.profile.Profile(*args, **kwargs)[source]

Bases: django.db.models.base.Model

This class holds extra information about a member

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PROGRAMME_CHOICES = (('computingscience', 'Computing Science'), ('informationscience', 'Information Sciences'))
address_city

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

address_country

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

address_postal_code

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

address_street

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

address_street2

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

auto_renew

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

birthday

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

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

display_name()[source]
display_name_preference

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

email_gsuite_only

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

emergency_contact

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

emergency_contact_phone_number

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

event_permissions

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

get_address_country_display(*, field=<django.db.models.fields.CharField: address_country>)
get_auto_renew_display(*, field=<django.db.models.fields.BooleanField: auto_renew>)
get_display_name_preference_display(*, field=<django.db.models.fields.CharField: display_name_preference>)
get_event_permissions_display(*, field=<django.db.models.fields.CharField: event_permissions>)
get_language_display(*, field=<django.db.models.fields.CharField: language>)
get_programme_display(*, field=<django.db.models.fields.CharField: programme>)
id

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

initials

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

language

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

nickname

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_number

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

photo

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

profile_description

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

programme

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

receive_magazine

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

receive_newsletter

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

receive_optin

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

save(*args, **kwargs)[source]

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.

short_display_name()[source]
show_birthday

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

starting_year

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

student_number

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 a ForwardOneToOneDescriptor 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.