Skip to content

Commit 03e223f

Browse files
authored
[127] Podbicie SQLAlchemy oraz użycie model_dump (#166)
1 parent bf29312 commit 03e223f

File tree

5 files changed

+82
-64
lines changed

5 files changed

+82
-64
lines changed

alinka/widget/containers/main_body/content/settings/settings_tabs/schools_tab/select_school_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def populate_commune_combobox(self):
9292
self.commune_combobox.combobox.addItem(commune.name, commune.id)
9393

9494
@staticmethod
95-
def get_instytution_type_ids(school_type: SchoolTypes | None) -> list[int]:
95+
def get_institution_type_ids(school_type: SchoolTypes | None) -> list[int]:
9696
institution_types = rspo_client.list_institution_types()
9797
match school_type:
9898
case SchoolTypes.PRZEDSZKOLE.value:
@@ -129,7 +129,7 @@ def populate_schools_combobox(self):
129129
selected_district_id = self.district_combobox.combobox.currentData()
130130
selected_commune_id = self.commune_combobox.combobox.currentData()
131131
selected_school_type = self.school_type_combobox.combobox.currentText()
132-
institution_type_ids = self.get_instytution_type_ids(selected_school_type)
132+
institution_type_ids = self.get_institution_type_ids(selected_school_type)
133133
if not all([selected_province_id, selected_district_id, selected_commune_id]):
134134
return
135135
self.schools = rspo_client.list_institutions(

poetry.lock

Lines changed: 72 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Jinja2 = "^3.1.4"
1313
pydantic = "2.9.2"
1414
PySide6 = "6.8.3"
1515
python = "~3.12"
16-
SQLAlchemy = "2.0.4"
16+
SQLAlchemy = "2.0.43"
1717
pydantic-settings = "^2.5.2"
1818
alembic = "^1.13.2"
1919
requests = "^2.32.3"

tests/factories/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def _rspo(self):
309309
# and expand that dict
310310
return {
311311
"district_id": district.id,
312-
**faker.random_element(rspos).dict(),
312+
**faker.random_element(rspos).model_dump(),
313313
}
314314

315315
@lazy_attribute
@@ -359,7 +359,7 @@ def _rspo(self):
359359
province_id=province.id,
360360
district_id=district.id,
361361
# these ids are basically cached ouptut of
362-
# get_instytution_type_ids for all SchoolTypes
362+
# get_institution_type_ids for all SchoolTypes
363363
institution_type_ids=[1, 21, 82, 3, 90, 93, 94, 14, 17, 15, 19, 20, 16, 18],
364364
)
365365
).items

0 commit comments

Comments
 (0)