This commit is contained in:
darthsandmann
2016-11-07 17:59:41 +01:00
parent ea52ecc1a1
commit 9e8ac3d880
11 changed files with 197 additions and 24 deletions

View File

@ -38,9 +38,13 @@ class Application_cl(object):
#-------------------------------------------------------
def detail(self, cat=None, id=None):
#-------------------------------------------------------
print("Add: ", cat)
if(cat!=None):
return self.GenerateDetail(cat)
if(id!=None):
print("ID!=None Cat=", cat, " id=", id)
return self.GenerateDetail(cat, id)
else:
print("ID=None Cat=", cat)
return self.GenerateDetail(cat)
else:
return self.GenerateIndex()
@cherrypy.expose
@ -102,11 +106,12 @@ class Application_cl(object):
def GenerateDetail(self, category, id=None):
#-------------------------------------------------------
data = {}
data['category'] = category
if(id != None):
data['id'] = id
data['content'] = self.db.ReadEntry(category, id)
else:
data['id'] = None
data['category'] = category
data['content'] = self.db.GetDefault(category)
print(data, "\n")
return self.view.CreateDetail(data)