WEB/Praktikum2/ppm1/app/application.py

36 lines
1.2 KiB
Python
Raw Normal View History

2016-11-03 20:35:10 +01:00
import cherrypy
from .database import Database_cl
from .view import View_cl
#----------------------------------------------------------
class Application_cl(object):
#----------------------------------------------------------
#-------------------------------------------------------
def __init__(self):
#-------------------------------------------------------
# spezielle Initialisierung können hier eingetragen werden
self.db_o = Database_cl()
self.view_o = View_cl()
self.liste = 0
@cherrypy.expose
#-------------------------------------------------------
def delete(self, id, form=None):
#-------------------------------------------------------
# Eintrag löschen, dann Liste neu anzeigen
self.db_o.delete_px(id)
print("Delete",form)
return self.createList_p(form)
@cherrypy.expose
#-------------------------------------------------------
def default(self, *arguments, **kwargs):
#-------------------------------------------------------
msg_s = "unbekannte Anforderung: " + \
str(arguments) + \
''+ \
str(kwargs)
raise cherrypy.HTTPError(404, msg_s)
default.exposed= True