-
Notifications
You must be signed in to change notification settings - Fork 1
/
mobile.py
24 lines (19 loc) · 873 Bytes
/
mobile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import wsgiref.handlers
from dbinterface import DataStoreInterface
from google.appengine.ext import webapp
from stringFormatter import StringFormatter
class MobileHandler(webapp.RequestHandler):
def get(self):
formatter = StringFormatter()
datastore = DataStoreInterface()
queries = []
queries = formatter.getValues(self.request.query_string)
if len(queries) == 1:
if (datastore.companyProfileExists(queries[0]) == 1):
posts = datastore.getPosts(queries[0], 5)
for p in posts:
self.response.out.write(p.dbTitle + ' - ' + p.dbBody + '<br>')
else:
self.response.out.write('Company Not Found')
else:
self.response.out.write("unknown query")