naturtag.controllers.observation_controller module

class naturtag.controllers.observation_controller.DbPageResult(observations, total_results, is_empty)

Bases: object

Container to pass results from a worker thread to UI thread

is_empty: bool
observations: list[Observation]
total_results: int
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_page_received(observations)

Called each time the background sync saves a page to the DB

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=Slot, signature=display_observation(PyObject), parameters=PyObject   #36 type=Slot, signature=display_user_observations(QVariantList), parameters=QVariantList   #37 type=Slot, signature=on_db_page_loaded(PyObject), parameters=PyObject   #38 type=Slot, signature=on_sync_page_received(PyObject), parameters=PyObject   #39 type=Slot, signature=on_sync_complete() )
update_pagination_buttons()

Update pagination buttons, gating ‘next’ on pages that have been loaded