def read_stats(self, current_user_id: int, prj_ids: ProjectIDListT) -> List[ProjectTaxoStats]: """ Read classification statistics for these projects. """ # No security barrier because there is no private information inside return ProjectBO.read_taxo_stats(self.session, prj_ids)
def read_stats(self, current_user_id: Optional[UserIDT], prj_ids: ProjectIDListT, taxa_ids: Union[str, ClassifIDListT]) -> List[ProjectTaxoStats]: """ Read classification statistics for these projects. """ # No security barrier because there is no private information inside return ProjectBO.read_taxo_stats(self.session, prj_ids, taxa_ids)
def update_db_stats(self): """ Refresh the database for aggregates. """ project_ids = [ a_project.projid for a_project in self.collection.projects ] for a_project_id in project_ids: # Ensure the taxo stats are OK ProjectBO.update_taxo_stats(self.session, projid=a_project_id) # Ensure that the geography is OK propagated upwards from objects, for all projects inside the collection Sample.propagate_geo(self.session, prj_id=a_project_id) a_stat: ProjectTaxoStats for a_stat in ProjectBO.read_taxo_stats(self.session, project_ids, []): self.validated_count += a_stat.nb_validated