projekt finished
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -36,6 +36,7 @@ class Database_cl(object):
|
||||
#-------------------------------------------------------
|
||||
# Überprüfung der Datenn müsste ergänzt werden!
|
||||
id_s = self.nextId_p()
|
||||
data_opl['id'] = id_s
|
||||
# Datei erzeugen
|
||||
file_o = codecs.open(os.path.join(self.path_s , id_s+'.dat'), 'w', 'utf-8')
|
||||
file_o.write(json.dumps(data_opl, indent=3, ensure_ascii=True))
|
||||
|
@ -33,13 +33,13 @@ class Navigation_cl(object):
|
||||
#-------------------------------------------------------
|
||||
# Hinweis: könnte man auch aus einer Datei einlesen
|
||||
retVal_o = [
|
||||
{'action': 'modError' , 'text': 'Bearbeitung Fehlerdaten'},
|
||||
{'action': 'modProj' , 'text': 'Pflege Projekte'},
|
||||
{'action': 'modComp' , 'text': 'Pflege Komponenten'},
|
||||
{'action': 'modStaff' , 'text': 'Pflege Daten Mitarbeiter'},
|
||||
{'action': 'modCat' , 'text': 'Pflege Kategorien'},
|
||||
{'action': 'evalProj' , 'text': 'Auswertung Projekte/Fehler'},
|
||||
{'action': 'evalCat' , 'text': 'Auswertung Kategorien/Fehler'}
|
||||
{'action': 'fehler' , 'text': 'Bearbeitung Fehlerdaten'},
|
||||
{'action': 'projekt' , 'text': 'Pflege Projekte'},
|
||||
{'action': 'komponente' , 'text': 'Pflege Komponenten'},
|
||||
{'action': 'mitarbeiter' , 'text': 'Pflege Daten Mitarbeiter'},
|
||||
{'action': 'kategorien' , 'text': 'Pflege Kategorien'},
|
||||
{'action': 'prolist' , 'text': 'Auswertung Projekte/Fehler'},
|
||||
{'action': 'catlist' , 'text': 'Auswertung Kategorien/Fehler'}
|
||||
]
|
||||
|
||||
return json.dumps(retVal_o)
|
||||
|
@ -67,19 +67,67 @@ class Projekt_cl(object):
|
||||
#return json.dumps(retVal_o)
|
||||
|
||||
#-------------------------------------------------------
|
||||
def PUT(self):
|
||||
def PUT(self, data_opl):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
# Sichern der Daten: jetzt wird keine vollständige Seite
|
||||
# zurückgeliefert, sondern nur noch die Information, ob das
|
||||
# Speichern erfolgreich war
|
||||
|
||||
retVal_o = {
|
||||
'id': None
|
||||
}
|
||||
|
||||
# data_opl: Dictionary mit den gelieferten key-value-Paaren
|
||||
# hier müsste man prüfen, ob die Daten korrekt vorliegen!
|
||||
|
||||
id_s = data_opl["id_s"]
|
||||
data_o = {
|
||||
'name': data_opl["name_s"],
|
||||
'id': data_opl["id_s"]
|
||||
}
|
||||
# Update-Operation
|
||||
retVal_o['id'] = id_s
|
||||
if self.db_o.update_px(id_s, data_o):
|
||||
pass
|
||||
else:
|
||||
retVal_o['id'] = None
|
||||
|
||||
return retVal_o
|
||||
|
||||
#-------------------------------------------------------
|
||||
def POST(self):
|
||||
def POST(self, data_opl):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
retVal_o = {
|
||||
'id': None
|
||||
}
|
||||
|
||||
# data_opl: Dictionary mit den gelieferten key-value-Paaren
|
||||
|
||||
# hier müsste man prüfen, ob die Daten korrekt vorliegen!
|
||||
|
||||
data_o = {
|
||||
'name': data_opl["name_s"]
|
||||
}
|
||||
# Create-Operation
|
||||
id_s = self.db_o.create_px(data_o)
|
||||
retVal_o['id'] = id_s
|
||||
|
||||
return retVal_o
|
||||
|
||||
#-------------------------------------------------------
|
||||
def DELETE(self):
|
||||
def DELETE(self, id):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
# Eintrag löschen, nur noch Rückmeldung liefern
|
||||
retVal_o = {
|
||||
'id': id
|
||||
}
|
||||
|
||||
if self.db_o.delete_px(id):
|
||||
pass
|
||||
else:
|
||||
retVal_o['id'] = None
|
||||
|
||||
return retVal_o
|
||||
|
||||
|
||||
|
||||
|
@ -42,7 +42,7 @@ class Templates_cl(object):
|
||||
|
||||
files_a = os.listdir('templates')
|
||||
for fileName_s in files_a:
|
||||
file_o = codecs.open(os.path.join('templates', fileName_s), 'rU', 'utf-8')
|
||||
file_o = codecs.open(os.path.join('templates', fileName_s), 'rU', 'utf-8', errors='ignore')
|
||||
content_s = file_o.read()
|
||||
file_o.close()
|
||||
retVal_o["templates"][fileName_s] = content_s
|
||||
|
Reference in New Issue
Block a user