refactoring id naming

This commit is contained in:
2021-01-18 20:24:57 +01:00
parent 47d918cdbf
commit 559678715b
4 changed files with 30 additions and 30 deletions

View File

@ -3,10 +3,10 @@ from dbpool import getConnection, getOne, getMany
def get_wohnungen():
return getMany("""
SELECT w.id as id,
w.objekt as objekt_id,
w.shortname as wohnung,
w.objekt as objekt,
w.shortname as shortname,
w.flaeche as flaeche,
o.shortname as objekt
o.shortname as objekt_shortname
FROM wohnung w, objekt o
WHERE o.id = w.objekt
""", [], "Wohnung")
@ -14,10 +14,10 @@ SELECT w.id as id,
def get_wohnung(id=None):
return getOne("""
SELECT w.id as id,
w.objekt as objekt_id,
w.shortname as wohnung,
w.objekt as objekt,
w.shortname as shortname,
w.flaeche as flaeche,
o.shortname as objekt
o.shortname as objekt_shortname
FROM wohnung w, objekt o
WHERE o.id = w.objekt AND
w.id = ?
@ -26,10 +26,10 @@ SELECT w.id as id,
def get_wohnungen_by_objekt(id):
return getMany("""
SELECT w.id as id,
w.objekt as objekt_id,
w.shortname as wohnung,
w.objekt as objekt,
w.shortname as shortname,
w.flaeche as flaeche,
o.shortname as objekt
o.shortname as objekt_shortname
FROM wohnung w, objekt o
WHERE o.id = w.objekt AND
o.id = ?