apps.zoon.models.py
- class apps.zoon.models.AllCovenantedDocsManualCovenantManager(*args, **kwargs)
This model manager is mainly used for exports of all covenanted documents. It returns a list of all covenant/parcel combinations, so should not be used for covenant counts. It is reduced to a per-docnumber list in the export stage in apps/parcel/utils/export_utils.py The main model manager used for covenant exports is in apps/parcel/models.py. Unlike the main exporter, de-duping is not done here to eliminate multiple occurences of the same document.
- get_queryset()
Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.
- class apps.zoon.models.AllCovenantedDocsZooniverseManager(*args, **kwargs)
This model manager is mainly used for exports of all covenanted documents. It returns a list of all covenant/parcel combinations, so should not be used for covenant counts. It is reduced to a per-docnumber list in the export stage in apps/parcel/utils/export_utils.py The main model manager used for covenant exports is in apps/parcel/models.py. Unlike the main exporter, de-duping is not done here to eliminate multiple occurences of the same document.
- get_queryset()
Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.
- class apps.zoon.models.ExtraParcelCandidate(*args, **kwargs)
For use when property spans more than one block or addition, NOT for multiple lots in same addition/block for the moment
- Parameters:
id (BigAutoField) – Primary key: ID
epc_type (CharField) – Epc type
zoon_subject_id (IntegerField) – Zoon subject id
zoon_workflow_id (IntegerField) – Zoon workflow id
addition (CharField) – Addition
lot (TextField) – Lot
block (CharField) – Block
date_added (DateTimeField) – Date added
date_updated (DateTimeField) – Date updated
comments (TextField) – Comments
Relationship fields:
- Parameters:
workflow (
ForeignKeytoZooniverseWorkflow) – Workflow (related name:extraparcelcandidate)zooniverse_subject (
ForeignKeytoZooniverseSubject) – Zooniverse subject (related name:extraparcelcandidate)
- exception DoesNotExist
- exception MultipleObjectsReturned
- 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.
- class apps.zoon.models.ManualCorrection(*args, **kwargs)
This is set up as a separate model to preserve any manual work that is done in the event a re-import of zooniverse data is needed
- Parameters:
id (BigAutoField) – Primary key: ID
zoon_subject_id (IntegerField) – Zoon subject id
zoon_workflow_id (IntegerField) – Zoon workflow id
bool_covenant (BooleanField) – Bool covenant
covenant_text (TextField) – Covenant text
addition (CharField) – Addition
lot (TextField) – Lot
block (CharField) – Block
map_book (CharField) – Map book
map_book_page (CharField) – Map book page
seller (CharField) – Seller
buyer (CharField) – Buyer
deed_date (DateField) – Deed date
street_address (CharField) – Street address
city (CharField) – City
date_added (DateTimeField) – Date added
date_updated (DateTimeField) – Date updated
match_type (CharField) – Match type
bool_handwritten (BooleanField) – Bool handwritten
comments (TextField) – Comments
Relationship fields:
- Parameters:
workflow (
ForeignKeytoZooniverseWorkflow) – Workflow (related name:manualcorrection)zooniverse_subject (
ForeignKeytoZooniverseSubject) – Zooniverse subject (related name:manualcorrection)
- exception DoesNotExist
- exception MultipleObjectsReturned
- 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.
- class apps.zoon.models.ManualCovenant(id, workflow, bool_confirmed, covenant_text, addition, lot, block, map_book, map_book_page, seller, buyer, deed_date, doc_num, city, cov_type, comments, join_candidates, bool_parcel_match, date_added, date_updated, parcel_addresses, parcel_city)
- Parameters:
id (BigAutoField) – Primary key: ID
bool_confirmed (BooleanField) – Bool confirmed
covenant_text (TextField) – Covenant text
addition (CharField) – Addition
lot (TextField) – Lot
block (CharField) – Block
map_book (CharField) – Map book
map_book_page (CharField) – Map book page
seller (CharField) – Seller
buyer (CharField) – Buyer
deed_date (DateField) – Deed date
doc_num (CharField) – Doc num
city (CharField) – City
cov_type (CharField) – Cov type
comments (TextField) – Comments
join_candidates (JSONField) – Join candidates
bool_parcel_match (BooleanField) – Parcel match?
date_added (DateTimeField) – Date added
date_updated (DateTimeField) – Date updated
parcel_addresses (JSONField) – Parcel addresses
parcel_city (CharField) – Parcel city
Relationship fields:
- Parameters:
workflow (
ForeignKeytoZooniverseWorkflow) – Workflow (related name:manualcovenant)parcel_matches (
ManyToManyFieldtoParcel) – Parcel matches (related name:manualcovenant)
Reverse relationships:
- Parameters:
manualcovenantparcelpinlink (Reverse
ForeignKeyfromManualCovenantParcelPINLink) – All manual covenant parcel pin links of this manual covenant (related name ofmanual_covenant)manualsupportingdocument (Reverse
ForeignKeyfromManualSupportingDocument) – All manual supporting documents of this manual covenant (related name ofmanual_covenant)
- exception DoesNotExist
- exception MultipleObjectsReturned
- check_parcel_match(parcel_lookup=None)
Triggered by post_save signal
- 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.
- class apps.zoon.models.ManualCovenantParcelPINLink(*args, **kwargs)
A way to link to a parcel not based on join strings – a direct link to a manually entered modern Parcel PIN that matches a Parcel object. Note that this one is for ManualCovenant records, while the other one is for attaching to ZooniverseSubject objects
- Parameters:
id (BigAutoField) – Primary key: ID
parcel_pin (CharField) – Parcel pin
date_added (DateTimeField) – Date added
date_updated (DateTimeField) – Date updated
comments (TextField) – Comments
Relationship fields:
- Parameters:
workflow (
ForeignKeytoZooniverseWorkflow) – Workflow (related name:manualcovenantparcelpinlink)manual_covenant (
ForeignKeytoManualCovenant) – Manual covenant (related name:manualcovenantparcelpinlink)
- exception DoesNotExist
- exception MultipleObjectsReturned
- 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.
- class apps.zoon.models.ManualParcelPINLink(*args, **kwargs)
A way to link to a parcel not based on join strings – a direct link to a manually entered modern Parcel PIN that matches a Parcel object
- Parameters:
id (BigAutoField) – Primary key: ID
zoon_subject_id (IntegerField) – Zoon subject id
zoon_workflow_id (IntegerField) – Zoon workflow id
parcel_pin (CharField) – Parcel pin
date_added (DateTimeField) – Date added
date_updated (DateTimeField) – Date updated
comments (TextField) – Comments
Relationship fields:
- Parameters:
workflow (
ForeignKeytoZooniverseWorkflow) – Workflow (related name:manualparcelpinlink)zooniverse_subject (
ForeignKeytoZooniverseSubject) – Zooniverse subject (related name:manualparcelpinlink)
- exception DoesNotExist
- exception MultipleObjectsReturned
- 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.
- class apps.zoon.models.ManualSupportingDocument(*args, **kwargs)
An uploaded document that provides evidence of a racial covenant, which is attached to a ManualCovenant object.
- Parameters:
id (BigAutoField) – Primary key: ID
doc_type (CharField) – Doc type
doc_upload (FileField) – Doc upload
comments (TextField) – Comments
date_added (DateTimeField) – Date added
date_updated (DateTimeField) – Date updated
Relationship fields:
- Parameters:
workflow (
ForeignKeytoZooniverseWorkflow) – Workflow (related name:manualsupportingdocument)manual_covenant (
ForeignKeytoManualCovenant) – Manual covenant (related name:manualsupportingdocument)
- exception DoesNotExist
- exception MultipleObjectsReturned
- class apps.zoon.models.ReducedResponse_Question(*args, **kwargs)
Used for both question and dropdown types
- Parameters:
id (BigAutoField) – Primary key: ID
zoon_subject_id (IntegerField) – Zoon subject id
zoon_workflow_id (IntegerField) – Zoon workflow id
task_id (CharField) – Task id
question_type (CharField) – Question type
best_answer (TextField) – Best answer
best_answer_score (FloatField) – Best answer score
total_votes (IntegerField) – Total votes
answer_scores (JSONField) – Answer scores
- exception DoesNotExist
- exception MultipleObjectsReturned
- class apps.zoon.models.ReducedResponse_Text(id, zoon_subject_id, zoon_workflow_id, task_id, aligned_text, total_votes, consensus_text, consensus_score, user_ids)
- Parameters:
id (BigAutoField) – Primary key: ID
zoon_subject_id (IntegerField) – Zoon subject id
zoon_workflow_id (IntegerField) – Zoon workflow id
task_id (CharField) – Task id
aligned_text (JSONField) – Aligned text
total_votes (IntegerField) – Total votes
consensus_text (TextField) – Consensus text
consensus_score (IntegerField) – Consensus score
user_ids (JSONField) – User ids
- exception DoesNotExist
- exception MultipleObjectsReturned
- class apps.zoon.models.UnmappedZooniverseManager(*args, **kwargs)
This model manager is mainly used for exports OF NON-MAPPED COVENANTS ONLY. The main model manager used for covenant exports is in apps/parcel/models.py. Unlike the main exporter, de-duping is not done here to eliminate multiple occurences of the same document, and is not currently possible for unmapped covenants.
- get_queryset()
Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.
- class apps.zoon.models.ValidationZooniverseManager(*args, **kwargs)
This model manager is used to run statistics on retired subjects and for other analysis purposes
- get_queryset()
Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.
- class apps.zoon.models.ZooniverseResponseProcessed(*args, **kwargs)
Information about an individual transcription that will show up under a ZooniverseSubject during manual review. A more fully processed version of ZooniverseResponseRaw.
- Parameters:
id (BigAutoField) – Primary key: ID
classification_id (IntegerField) – Classification id
user_name (CharField) – User name
user_id (IntegerField) – User id
zoon_subject_id (IntegerField) – Zoon subject id
bool_covenant (CharField) – Bool covenant
covenant_text (TextField) – Covenant text
addition (CharField) – Addition
lot (TextField) – Lot
block (CharField) – Block
map_book (CharField) – Map book
map_book_page (CharField) – Map book page
city (CharField) – City
seller (CharField) – Seller
buyer (CharField) – Buyer
match_type (CharField) – Match type
bool_handwritten (CharField) – Bool handwritten
deed_date_year (CharField) – Deed date year
deed_date_month (CharField) – Deed date month
deed_date_day (CharField) – Deed date day
created_at (DateTimeField) – Created at
Relationship fields:
- Parameters:
workflow (
ForeignKeytoZooniverseWorkflow) – Workflow (related name:zooniverseresponseprocessed)subject (
ForeignKeytoZooniverseSubject) – Subject (related name:responses)response_raw (
ForeignKeytoZooniverseResponseRaw) – Response raw (related name:zooniverseresponseprocessed)
- exception DoesNotExist
- exception MultipleObjectsReturned
- class apps.zoon.models.ZooniverseResponseRaw(*args, **kwargs)
Information imported after Zooniverse transcription in its natural state after Zooniverse’s panoptes-aggregation scripts. Most useful data is still contained inside annotations and subject_data fields, which will be further processed to produce a ZooniverseResponseProcessed.
- Parameters:
id (BigAutoField) – Primary key: ID
classification_id (IntegerField) – Classification id
user_name (CharField) – User name
user_id (IntegerField) – User id
workflow_id (IntegerField) – Workflow id
workflow_name (CharField) – Workflow name
workflow_version (FloatField) – Workflow version
created_at (DateTimeField) – Created at
gold_standard (BooleanField) – Gold standard
expert (BooleanField) – Expert
metadata (JSONField) – Metadata
annotations (JSONField) – Annotations
subject_data (JSONField) – Subject data
subject_ids (IntegerField) – Subject ids
subject_data_flat (JSONField) – Subject data flat
Relationship fields:
- Parameters:
subject (
ForeignKeytoZooniverseSubject) – Subject (related name:zooniverseresponseraw)
Reverse relationships:
- Parameters:
zooniverseresponseprocessed (Reverse
ForeignKeyfromZooniverseResponseProcessed) – All zooniverse response processeds of this zooniverse response raw (related name ofresponse_raw)
- exception DoesNotExist
- exception MultipleObjectsReturned
- class apps.zoon.models.ZooniverseSubject(*args, **kwargs)
This is the main model representing an individual suspected covenant coming back from Zooniverse transcription. Each subject should have five individual transcription responses, which will be aggregated to be displayed with each ZooniverseSubject. Possible future task: Assign an id to correspond to a deed image pre-Zooniverse
- Parameters:
id (BigAutoField) – Primary key: ID
zoon_subject_id (IntegerField) – Zoon subject id
image_ids (JSONField) – Image ids
image_links (JSONField) – Image links
dt_retired (DateTimeField) – Dt retired
bool_covenant (BooleanField) – Bool covenant
bool_problem (BooleanField) – Bool problem
covenant_text (TextField) – Covenant text
addition (CharField) – Addition
lot (TextField) – Lot
block (CharField) – Block
map_book (CharField) – Map book
map_book_page (CharField) – Map book page
city (CharField) – City
seller (CharField) – Seller
buyer (CharField) – Buyer
deed_date (DateField) – Deed date
match_type (CharField) – Match type
bool_handwritten (BooleanField) – Bool handwritten
deedpage_pk (IntegerField) – Deedpage pk
deedpage_doc_num (CharField) – Deedpage doc num
deedpage_s3_lookup (CharField) – Deedpage s3 lookup
bool_covenant_score (FloatField) – Bool covenant score
bool_handwritten_score (FloatField) – Bool handwritten score
match_type_score (FloatField) – Match type score
covenant_text_score (FloatField) – Covenant text score
addition_score (FloatField) – Addition score
lot_score (FloatField) – Lot score
block_score (FloatField) – Block score
map_book_score (FloatField) – Map book score
map_book_page_score (FloatField) – Map book page score
city_score (FloatField) – City score
seller_score (FloatField) – Seller score
buyer_score (FloatField) – Buyer score
deed_date_overall_score (FloatField) – Deed date overall score
deed_date_year_score (FloatField) – Deed date year score
deed_date_month_score (FloatField) – Deed date month score
deed_date_day_score (FloatField) – Deed date day score
median_score (FloatField) – Median score
bool_manual_correction (BooleanField) – Manual updates?
bool_covenant_final (BooleanField) – Racial covenant?
covenant_text_final (TextField) – Covenant text
addition_final (CharField) – Addition
lot_final (TextField) – Lot
block_final (CharField) – Block
map_book_final (CharField) – Map Book
map_book_page_final (CharField) – Map Book Page
seller_final (CharField) – Seller name
buyer_final (CharField) – Buyer name
deed_date_final (DateField) – Deed date
street_address_final (TextField) – Street address
city_final (CharField) – City
match_type_final (CharField) – Match type
bool_handwritten_final (BooleanField) – Handwritten?
bool_parcel_match (BooleanField) – Parcel match?
join_candidates (JSONField) – Join candidates
parcel_addresses (JSONField) – Parcel addresses
parcel_city (CharField) – Parcel city
geom_union_4326 (MultiPolygonField) – Geom union 4326
date_updated (DateTimeField) – Date updated
Relationship fields:
- Parameters:
workflow (
ForeignKeytoZooniverseWorkflow) – Workflow (related name:zooniversesubject)parcel_matches (
ManyToManyFieldtoParcel) – Parcel matches (related name:zooniversesubject)
Reverse relationships:
- Parameters:
subject_legacy (Reverse
ForeignKeyfromDeedPage) – All subject legacy of this zooniverse subject (related name ofzooniverse_subject)subject_1st_page (Reverse
ForeignKeyfromDeedPage) – All subject 1st page of this zooniverse subject (related name ofzooniverse_subject_1st_page)subject_2nd_page (Reverse
ForeignKeyfromDeedPage) – All subject 2nd page of this zooniverse subject (related name ofzooniverse_subject_2nd_page)subject_3rd_page (Reverse
ForeignKeyfromDeedPage) – All subject 3rd page of this zooniverse subject (related name ofzooniverse_subject_3rd_page)zooniverseresponseraw (Reverse
ForeignKeyfromZooniverseResponseRaw) – All zooniverse response raws of this zooniverse subject (related name ofsubject)responses (Reverse
ForeignKeyfromZooniverseResponseProcessed) – All responses of this zooniverse subject (related name ofsubject)manualcorrection (Reverse
ForeignKeyfromManualCorrection) – All manual corrections of this zooniverse subject (related name ofzooniverse_subject)extraparcelcandidate (Reverse
ForeignKeyfromExtraParcelCandidate) – All extra parcel candidates of this zooniverse subject (related name ofzooniverse_subject)manualparcelpinlink (Reverse
ForeignKeyfromManualParcelPINLink) – All manual parcel pin links of this zooniverse subject (related name ofzooniverse_subject)
- exception DoesNotExist
- exception MultipleObjectsReturned
- 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.
- class apps.zoon.models.ZooniverseUser(*args, **kwargs)
Temp: duplicated from apps.deed.models. May or may not be needed later, but not actually doing anything on this app currently.
- Parameters:
id (BigAutoField) – Primary key: ID
zoon_id (IntegerField) – Zoon id
zoon_name (CharField) – Zoon name
- exception DoesNotExist
- exception MultipleObjectsReturned
- class apps.zoon.models.ZooniverseWorkflow(*args, **kwargs)
The main shell that keeps each project separate from others. Generally, each county will require a separate ZooniverseWorkflow object.
- Parameters:
id (BigAutoField) – Primary key: ID
zoon_id (IntegerField) – Zoon id
workflow_name (CharField) – Workflow name
version (CharField) – Version
slug (CharField) – Slug
Reverse relationships:
- Parameters:
deedpage (Reverse
ForeignKeyfromDeedPage) – All deed pages of this zooniverse workflow (related name ofworkflow)searchhitreport (Reverse
ForeignKeyfromSearchHitReport) – All search hit reports of this zooniverse workflow (related name ofworkflow)parcel (Reverse
ForeignKeyfromParcel) – All parcels of this zooniverse workflow (related name ofworkflow)parceljoincandidate (Reverse
ForeignKeyfromParcelJoinCandidate) – All parcel join candidates of this zooniverse workflow (related name ofworkflow)manualparcelcandidate (Reverse
ForeignKeyfromManualParcelCandidate) – All manual parcel candidates of this zooniverse workflow (related name ofworkflow)joinreport (Reverse
ForeignKeyfromJoinReport) – All join reports of this zooniverse workflow (related name ofworkflow)shpexport (Reverse
ForeignKeyfromShpExport) – All shp exports of this zooniverse workflow (related name ofworkflow)geojsonexport (Reverse
ForeignKeyfromGeoJSONExport) – All geo json exports of this zooniverse workflow (related name ofworkflow)pmtilesexport (Reverse
ForeignKeyfromPMTilesExport) – All pm tiles exports of this zooniverse workflow (related name ofworkflow)csvexport (Reverse
ForeignKeyfromCSVExport) – All csv exports of this zooniverse workflow (related name ofworkflow)unmappedcsvexport (Reverse
ForeignKeyfromUnmappedCSVExport) – All unmapped csv exports of this zooniverse workflow (related name ofworkflow)validationcsvexport (Reverse
ForeignKeyfromValidationCSVExport) – All validation csv exports of this zooniverse workflow (related name ofworkflow)allcovenanteddocscsvexport (Reverse
ForeignKeyfromAllCovenantedDocsCSVExport) – All all covenanted docs csv exports of this zooniverse workflow (related name ofworkflow)dischargecsvexport (Reverse
ForeignKeyfromDischargeCSVExport) – All discharge csv exports of this zooniverse workflow (related name ofworkflow)covenantedparcel (Reverse
ForeignKeyfromCovenantedParcel) – All covenanted parcels of this zooniverse workflow (related name ofworkflow)plat (Reverse
ForeignKeyfromPlat) – All plats of this zooniverse workflow (related name ofworkflow)platalternatename (Reverse
ForeignKeyfromPlatAlternateName) – All plat alternate names of this zooniverse workflow (related name ofworkflow)subdivision (Reverse
ForeignKeyfromSubdivision) – All subdivisions of this zooniverse workflow (related name ofworkflow)subdivisionalternatename (Reverse
ForeignKeyfromSubdivisionAlternateName) – All subdivision alternate names of this zooniverse workflow (related name ofworkflow)zooniversesubject (Reverse
ForeignKeyfromZooniverseSubject) – All zooniverse subjects of this zooniverse workflow (related name ofworkflow)zooniverseresponseprocessed (Reverse
ForeignKeyfromZooniverseResponseProcessed) – All zooniverse response processeds of this zooniverse workflow (related name ofworkflow)manualcorrection (Reverse
ForeignKeyfromManualCorrection) – All manual corrections of this zooniverse workflow (related name ofworkflow)extraparcelcandidate (Reverse
ForeignKeyfromExtraParcelCandidate) – All extra parcel candidates of this zooniverse workflow (related name ofworkflow)manualparcelpinlink (Reverse
ForeignKeyfromManualParcelPINLink) – All manual parcel pin links of this zooniverse workflow (related name ofworkflow)manualcovenant (Reverse
ForeignKeyfromManualCovenant) – All manual covenants of this zooniverse workflow (related name ofworkflow)manualcovenantparcelpinlink (Reverse
ForeignKeyfromManualCovenantParcelPINLink) – All manual covenant parcel pin links of this zooniverse workflow (related name ofworkflow)manualsupportingdocument (Reverse
ForeignKeyfromManualSupportingDocument) – All manual supporting documents of this zooniverse workflow (related name ofworkflow)
- exception DoesNotExist
- exception MultipleObjectsReturned
- 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.