rattail.db.model.people

Data Models for People

class rattail.db.model.people.MergePeopleRequest(**kwargs)[source]

Represents a request to merge 2 people. If the request is no longer wanted then it should be deleted. Otherwise it should be updated to reflect who satisfies the request, by performing the merge.

keeping_uuid

UUID of the person to be “preserved”, into which the “unwanted” person is to be merged.

merged

Date and time when the merge was performed.

merged_by

Reference to the User who performed the merge.

removing_uuid

UUID of the “unwanted” person, which is to be merged into the “preserved” person.

requested

Date and time when the request was made.

requested_by

Reference to the User who created the request.

class rattail.db.model.people.Person(**kwargs)[source]

Represents a real, living and breathing person.

(Or, at least was previously living and breathing, in the case of the deceased.)

customer_accounts

List of customer records for which this person is the account holder.

customer_shoppers

List of all shopper records for this person, under various customer accounts.

emails

Sequence of PersonEmailAddress instances which belong to the person.

employee

Reference to the Employee record for the person, if there is one.

first_name

Person’s “true” first name.

first_valid_email()[source]

Returns the first Email which has not been marked invalid, or None.

first_valid_email_address()[source]

Returns the first email address which has not been marked invalid, or None.

invalid_address

Flag indicating the person’s mailing address(es) on file are invalid.

last_name

Person’s last name.

local_only

Flag indicating the person is somehow specific to the “local” app node etc. and should not be synced elsewhere.

members

Sequence of member records with which this person is associated.

middle_name

Person’s middle name (or initial), if applicable/known.

notes

Sequence of notes which belong to the person.

only_customer(require=True)[source]

DEPRECATED

Convenience method to retrieve the one and only Customer record which is associated with this person. An error will be raised if there is not exactly one customer associated.

phones

Sequence of PersonPhoneNUmber instances which belong to the person.

preferred_first_name

Preferred first name for the person, if applicable. When present, this may be used instead of the first_name value, when displaying the person’s full name etc.

users

List of user accounts for the person. Typically there is only one user account per person, but technically multiple are allowed.

class rattail.db.model.people.PersonContactInfoMixin[source]

Base mixin class for person contact info models.

Parent

alias of Person

class rattail.db.model.people.PersonEmailAddress(**kwargs)[source]

Represents an email address associated with a person.

invalid

Flag indicating whether the email address is known to be invalid. Defaults to NULL, meaning the validity is “not known”.

person

Reference to the Person instance to which the email address belongs.

class rattail.db.model.people.PersonMailingAddress(**kwargs)[source]

Represents a physical / mailing address associated with a person.

class rattail.db.model.people.PersonNote(**kwargs)[source]

Represents a note attached to a person.

person

Reference to the person to which the note is attached.

class rattail.db.model.people.PersonPhoneNumber(**kwargs)[source]

Represents a phone (or fax) number associated with a person.

person

Reference to the Person instance to which the phone number belongs.