generated from dopt-python/py311
added expected behaviour
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,9 @@ from PySide6.QtCore import QDate, Qt
|
|||||||
from wce_crm import constants, db
|
from wce_crm import constants, db
|
||||||
from wce_crm.backend import backend
|
from wce_crm.backend import backend
|
||||||
|
|
||||||
|
# %%
|
||||||
|
int("test")
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
db_path = constants.Config.DB_PATH_MAIN
|
db_path = constants.Config.DB_PATH_MAIN
|
||||||
crm_path = constants.Config.DB_PATH_CRM
|
crm_path = constants.Config.DB_PATH_CRM
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import dataclasses as dc
|
import dataclasses as dc
|
||||||
|
import datetime
|
||||||
from typing import Any, TypedDict, cast
|
from typing import Any, TypedDict, cast
|
||||||
|
|
||||||
import polars as pl
|
import polars as pl
|
||||||
@@ -185,13 +186,15 @@ class FrontpageCompany:
|
|||||||
erfassung_id: int
|
erfassung_id: int
|
||||||
ma_id: int
|
ma_id: int
|
||||||
name: str
|
name: str
|
||||||
|
Metadaten_aktualisierung: datetime.datetime
|
||||||
|
|
||||||
|
|
||||||
def get_company_list() -> list[FrontpageCompany]:
|
def get_company_list() -> list[FrontpageCompany]:
|
||||||
stmt = sql.select(
|
stmt = sql.select(
|
||||||
db.grunderfassung_unternehmen.c.erfassung_id,
|
db.grunderfassung_unternehmen.c.erfassung_id,
|
||||||
db.grunderfassung_unternehmen.c.Partnersuche__un_suche,
|
db.grunderfassung_unternehmen.c.Partnersuche__un_suche,
|
||||||
)
|
db.grunderfassung_unternehmen.c.Metadaten_aktualisierung,
|
||||||
|
).order_by(db.grunderfassung_unternehmen.c.Metadaten_aktualisierung.desc())
|
||||||
|
|
||||||
with db.ENGINE.connect() as conn:
|
with db.ENGINE.connect() as conn:
|
||||||
res = conn.execute(stmt)
|
res = conn.execute(stmt)
|
||||||
@@ -201,9 +204,12 @@ def get_company_list() -> list[FrontpageCompany]:
|
|||||||
for entry in res:
|
for entry in res:
|
||||||
erfassung_id = entry[0]
|
erfassung_id = entry[0]
|
||||||
ma_id = entry[1]
|
ma_id = entry[1]
|
||||||
|
datetime_akt = cast(datetime.datetime, entry[2])
|
||||||
|
datetime_akt = datetime_akt.astimezone()
|
||||||
|
|
||||||
comp_info = comp_search_get_info(ma_id)
|
comp_info = comp_search_get_info(ma_id)
|
||||||
name = comp_info["ma_unternehmensname"]
|
name = comp_info["ma_unternehmensname"]
|
||||||
|
|
||||||
front_page_companies.append(FrontpageCompany(erfassung_id, ma_id, name))
|
front_page_companies.append(FrontpageCompany(erfassung_id, ma_id, name, datetime_akt))
|
||||||
|
|
||||||
return front_page_companies
|
return front_page_companies
|
||||||
|
|||||||
Reference in New Issue
Block a user