refactoring id naming

This commit is contained in:
Wolfgang Hottgenroth 2021-01-18 20:24:57 +01:00
parent 47d918cdbf
commit 559678715b
Signed by: wn
GPG Key ID: E49AF3B9EF6DD469
4 changed files with 30 additions and 30 deletions

View File

@ -3,10 +3,10 @@ from dbpool import getConnection, getMany, getOne
def get_mieters():
return getMany("""
SELECT m.id as id,
o.id as objekt_id,
w.id as wohnung_id,
w.shortname as wohnung,
o.shortname as objekt,
o.id as objekt,
w.id as wohnung,
w.shortname as wohnung_shortname,
o.shortname as objekt_shortname,
COALESCE(m.anrede, '-') as anrede,
COALESCE(m.vorname, '-') as vorname,
m.nachname as nachname,
@ -24,10 +24,10 @@ SELECT m.id as id,
def get_mieter(id=None):
return getOne("""
SELECT m.id as id,
o.id as objekt_id,
w.id as wohnung_id,
w.shortname as wohnung,
o.shortname as objekt,
o.id as objekt,
w.id as wohnung,
w.shortname as wohnung_shortname,
o.shortname as objekt_shortname,
COALESCE(m.anrede, '-') as anrede,
COALESCE(m.vorname, '-') as vorname,
m.nachname as nachname,

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 = ?

View File

@ -3,7 +3,7 @@ from dbpool import getConnection, getOne, getMany
def get_zahlungen_by_mieter(mieter_id):
return getMany("""
SELECT id,
mieter as mieter_id,
mieter,
datum_ist,
datum_soll
betrag,
@ -15,7 +15,7 @@ SELECT id,
def get_zahlung(id):
return getOne("""
SELECT id,
mieter as mieter_id
mieter
datum_ist,
datum_soll
betrag,
@ -28,7 +28,7 @@ SELECT id,
def get_forderungen_by_mieter(mieter_id):
return getMany("""
SELECT id,
mieter as mieter_id,
mieter
datum,
betrag,
kommentar,
@ -40,7 +40,7 @@ SELECT id,
def get_forderung(id):
return getOne("""
SELECT id,
mieter as mieter_id
mieter
datum,
betrag,
kommentar,

View File

@ -254,13 +254,13 @@ definitions:
properties:
id:
type: integer
objekt_id:
objekt:
type: integer
wohnung:
wohnung_shortname:
type: string
flaeche:
type: number
objekt:
objekt_shortname:
type: string
Mieter:
description: Mieter type
@ -268,13 +268,13 @@ definitions:
properties:
id:
type: integer
objekt_id:
objekt:
type: integer
wohnung_id:
wohnung:
type: integer
wohnung:
wohnung_shortname:
type: string
objekt:
objekt_shortname:
type: string
anrede:
type: string
@ -300,7 +300,7 @@ definitions:
properties:
id:
type: integer
mieter_id:
mieter:
type: integer
datum:
type: string
@ -316,7 +316,7 @@ definitions:
properties:
id:
type: integer
mieter_id:
mieter:
type: integer
datum_ist:
type: string