32 lines
978 B
Python
32 lines
978 B
Python
# coding: utf-8
|
|
|
|
import json
|
|
import cherrypy
|
|
from app import database
|
|
|
|
#-------------------------------------------------------
|
|
class Choice(object):
|
|
#-------------------------------------------------------
|
|
|
|
exposed = True # gilt für alle Methoden
|
|
|
|
#-------------------------------------------------------
|
|
def __init__(self):
|
|
#-------------------------------------------------------
|
|
self.db = database.Database()
|
|
|
|
#-------------------------------------------------------
|
|
def GET(self):
|
|
#-------------------------------------------------------
|
|
self.db.ReadAll()
|
|
data = {}
|
|
data['content'] = {}
|
|
offerings = self.db.data['Angebote']
|
|
for key, value in offerings.items():
|
|
for key2, value2 in value.items():
|
|
if(key2 == 'Status'):
|
|
if(value2 == 'Angebot'):
|
|
data['content'][key] = value
|
|
print(data)
|
|
return json.dumps(data)
|