Example #1
0
ALLOWED_FIELDS = set(VALID_PASSPORT_DATA.keys())
ALLOWED_DATA_SOURCE_KINDS = [
    'genebank', 'study', 'project', 'passport_collector', 'Governamental'
]

ALLOWED_SUBTAXA = ['subspecies', 'variety', 'convarietas', 'group', 'forma']
ALLOWED_TAXONOMIC_RANKS = ['family', 'genus', 'species'] + ALLOWED_SUBTAXA
ALLOWED_COLLECTING_SITE_KEYS = [
    COUNTRY, STATE, PROVINCE, ISLAND, MUNICIPALITY, OTHER, SITE, LATITUDE,
    LONGITUDE, ALTITUDE, GEOREF_METHOD, COORDUNCERTAINTY,
    COORD_SPATIAL_REFERENCE
]
ALLOWED_REMARKS_KEYS = ['collection', 'genebank_management']

ALLOWED_COUNTRIES = list(countries_by_alpha3.keys())
OLD_COUNTRIES = set(OLD_COUNTRIES.values())
ALLOWED_COUNTRIES.extend(OLD_COUNTRIES)

NOW_YEAR = datetime.now().year


def _check_accession_number(accession_number,
                            required_fields=(INSTITUTE_CODE,
                                             GERMPLASM_NUMBER)):
    if GERMPLASM_NUMBER in accession_number:
        assert isinstance(accession_number[GERMPLASM_NUMBER], str)
    if required_fields:
        required_fields = set(required_fields)
        missing_fields = required_fields.difference(accession_number.keys())
        if missing_fields:
 def __init__(self):
     self.description = "Sample description"
     self.countries = countries_by_alpha3.keys()
     self.ip_geolocation_report_template = {c: 0 for c in self.countries}