Praktikum2
This commit is contained in:
36
Praktikum2/ppm1/app/application.py
Normal file
36
Praktikum2/ppm1/app/application.py
Normal file
@@ -0,0 +1,36 @@
|
||||
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
|
||||
Reference in New Issue
Block a user