naturtag.controllers.taxon_controller module¶
- class naturtag.controllers.taxon_controller.TaxonController¶
Bases:
BaseController
Controller for searching and viewing taxa
- bind_selection(taxon_cards)¶
Connect click signal from each taxon card
- display_taxon(taxon, notify=True)¶
- display_taxon_by_id(taxon_id)¶
Load a taxon by ID and update info display. Taxon API request will be sent from a separate thread, return to main thread, and then display info will be loaded from a separate thread.
- on_select¶
A taxon was selected
- set_search_results(taxa)¶
Load search results into Results tab
- staticMetaObject = PySide6.QtCore.QMetaObject("TaxonController" inherits "BaseController": Methods: #34 type=Signal, signature=on_select(PyObject), parameters=PyObject #35 type=Slot, signature=display_taxon_by_id(int), parameters=int #36 type=Slot, signature=display_taxon(PyObject), parameters=PyObject )¶
- class naturtag.controllers.taxon_controller.TaxonTabs(user_taxa, parent=None)¶
Bases:
QTabWidget
Tabbed view for search results and user taxa
- display_observed(taxon_counts)¶
After fetching observation taxon counts for the user, add info cards for them
- display_recent(taxa)¶
After fetching taxon records for recent and frequent, add info cards for them in the appropriate tabs
- get_user_observed_taxa()¶
Get counts of taxa observed by the user, ordered by number of observations descending
- Return type:
- load_user_taxa()¶
- on_load¶
New taxon cards were loaded
- resizeEvent(event)¶
On resize, show tab labels if there is enough room for at least a couple characters each (plus ‘…’), otherwise collapse to icons only
- staticMetaObject = PySide6.QtCore.QMetaObject("TaxonTabs" inherits "QTabWidget": Methods: #39 type=Signal, signature=on_load(QVariantList), parameters=QVariantList #40 type=Slot, signature=display_recent(QVariantList), parameters=QVariantList #41 type=Slot, signature=display_observed(QVariantList), parameters=QVariantList #42 type=Slot, signature=update_history(PyObject), parameters=PyObject )¶
- update_history(taxon)¶
Update history and frequent lists with the selected taxon. If it was already in one or both lists, update its position in the list(s).