Models

class specimens.models.Person(*args, **kwargs)

A model that represents a Person object.

first_name

The person’s first name.

Type:

str

middle_initial

The person’s middle initial.

Type:

str

last_name

The person’s last name.

Type:

str

suffix

The person’s suffix (if they have one).

Type:

str

date_created

The date when the object instance was created. Inherited from TimeStampMixin.

Type:

datetime

date_modified

The date when the object instance was last modified. Inherited from TimeStampMixin.

Type:

datetime

__str__()

Returns a string representation of a Person object instance.

Returns:

A string that refers to a Person object instance.

collector_name

A person’s name formatted for a specimen label.

The format is a person’s first initial, last name, and suffix (if they have one).

full_name

A person’s full name.

The format is a person’s first name, middle initial (if one is provided), last name, and suffix (if they have one).

class specimens.models.SpecimenRecord(*args, **kwargs)

A model for a SpecimenRecord object.

This model has a TON of fields on it, as it’s important to have detailed data for specimens in a collection. These details include the specimen’s taxonomy, its preparation, its locality, and the conditions under which it was captured.

usi

The Unique Specimen Identifier (USI) number. I am setting it as my initials followed by a dash and a number (which I increment with each specimen added to the collection).

Type:

str

order

The order to which the specimen belongs.

Type:

Order

family

The family to which the specimen belongs.

Type:

Family

subfamily

The subfamily to which the specimen belongs.

Type:

Subfamily

tribe

The tribe to which the specimen belongs.

Type:

Tribe

genus

The genus to which the specimen belongs.

Type:

Genus

species

The species to which the specimen belongs.

Type:

Species

subspecies

The subspecies to which the specimen belongs, if the species has one.

Type:

Subspecies

determiner

The person who determined (identified) the specimen.

Type:

Person

determined_year

The year the determination was made.

Type:

int

sex

The sex of the specimen.

Type:

str

stage

The stage of the specimen.

Type:

str

preparer

The person who prepared the specimen.

Type:

Person

preparation

The preparation type of the specimen.

Type:

str

preparation_date

The date the specimen was prepared.

Type:

date

labels_printed

Whether labels have been printed for the specimen.

Type:

bool

labeled

Whether the specimen has been labeled.

Type:

bool

photographed

Whether the specimen has been photographed.

Type:

bool

collecting_trip

The collecting trip on which the specimen was collected.

Type:

CollectingTrip

country

The country in which the specimen was collected.

Type:

Country

state

The state in which the specimen was collected.

Type:

State

county

The county in which the specimen was collected.

Type:

County

locality

The locality at which the specimen was collected.

Type:

Locality

gps

The GPS coordinates at which the specimen was collected.

Type:

GPS

day

The day on which the specimen was collected.

Type:

int

month

The month in which the specimen was collected.

Type:

str

year

The year in which the specimen was collected.

Type:

int

collector

The collector(s) who collected the specimen.

Type:

Person

method

The method used to collect the specimen.

Type:

str

weather

A brief description of the weather conditions during the specimen’s capture.

Type:

str

temperature

The outdoor temperature during the specimen’s capture. It is a string rather than a float so that I have control on whether or not a decimal point on the field is serialized.

Type:

str

time_of_day

The time of day (or night) the specimen was captured.

Type:

str

habitat

The habitat details of where the specimen was captured.

Type:

str

notes

Any additional notes about the specimen.

Type:

str

date_created

The date when the object instance was created. Inherited from TimeStampMixin.

Type:

datetime

date_modified

The date when the object instance was last modified. Inherited from TimeStampMixin.

Type:

datetime

__str__()

Returns a string representation of a SpecimenRecord object instance.

Returns:

A string that refers to a SpecimenRecord object instance.

identified

A boolean representing whether or not a specimen is identified to species.

collected_date

The collected date used for specimen labels.

Because the day, month, and year fields are optional, these fields must be checked. Fields with non-null values are used to construct the final formatted date.

Examples of possible dates include “1-Jan-2000”, “Jan 2000”, and “2000”.

full_date

The full date on which a specimen was collected.

Because the day, month, and year fields are optional, these fields must be checked. Fields with non-null values are used to construct the final formatted date.

Examples of possible dates include “1 January 2000”, “January 2000”, and “2000”.

num_date

The date on which a specimen was collected, formatted as YYYY-MM-DD.

Because the day, month, and year fields are optional, these fields must be checked. Fields with non-null values are used to construct the final numerical date.

collectors

All collector names for a given specimen joined into a string.

temp_F

Temperature with “F” (Fahrenheit) appended to the end.

temp_C

Temperature with “C” (Celsius) appended to the end.