naturtag.controllers.observation_controller module¶
- class naturtag.controllers.observation_controller.DbPageResult(observations, total_results, is_empty)¶
Bases:
objectContainer to pass results from a worker thread to UI thread
-
is_empty:
bool¶
-
observations:
list[Observation]¶
-
total_results:
int¶
-
is_empty:
- class naturtag.controllers.observation_controller.ObservationController¶
Bases:
BaseController- bind_selection(obs_cards)¶
Connect click signal from each observation card
- display_observation(observation)¶
Display full details for a single observation
- display_observation_by_id(observation_id)¶
Display full observation details
- display_user_observations(observations)¶
Display a page of observations
- load_observations_from_db()¶
Read the current page of observations from the local DB and display them
- next_page()¶
- on_db_page_loaded(result)¶
Handle DB page result on the main thread
- on_sync_complete()¶
Called when the background sync finishes
- on_sync_finished¶
Emitted when the background sync completes
- on_sync_page_received(observations)¶
Called each time the background sync saves a page to the DB
- on_sync_progress¶
(loaded_count, total_count) as pages arrive
- on_view_taxon¶
Request to switch to taxon tab
- prev_page()¶
- refresh()¶
- start_background_sync()¶
Kick off a background worker to fetch all new/updated observations from the API
- staticMetaObject = PySide6.QtCore.QMetaObject("ObservationController" inherits "BaseController": Methods: #34 type=Signal, signature=on_view_taxon(PyObject), parameters=PyObject #35 type=Signal, signature=on_sync_progress(int,int), parameters=int, int #36 type=Signal, signature=on_sync_finished() #37 type=Slot, signature=display_observation(PyObject), parameters=PyObject #38 type=Slot, signature=display_user_observations(QVariantList), parameters=QVariantList #39 type=Slot, signature=on_db_page_loaded(PyObject), parameters=PyObject #40 type=Slot, signature=on_sync_page_received(PyObject), parameters=PyObject #41 type=Slot, signature=on_sync_complete() )¶
- update_pagination_buttons()¶
Update pagination buttons, gating ‘next’ on pages that have been loaded