-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlatihan.py
35 lines (26 loc) · 996 Bytes
/
latihan.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
25
26
27
28
29
30
31
32
33
34
35
from google.appengine.ext import webapp
from google.appengine.ext import db
from google.appengine.ext.webapp import util
from base import BaseRequestHandler
from django.utils import simplejson
class Article(db.Model):
title = db.StringProperty()
content = db.StringProperty(multiline=True)
class ArticleListHandler(BaseRequestHandler):
def get(self,key):
if key != None:
db.delete(key)
self.render('latihan.html',{'articles':Article.all()})
def post(self,key):
self.response.out.write('out')
self.response.out.write(self.request.get_all('title'))
#Article(title=self.request.get('title'),
# content=self.request.get('content')).put()
#self.get(key)
def main():
application = webapp.WSGIApplication([
('/latihan/?(?P<key>\w+)?\.php',ArticleListHandler),
],debug=True)
util.run_wsgi_app(application)
if __name__ == '__main__':
main()