diff options
Diffstat (limited to 'controllers/default.py.1')
-rw-r--r-- | controllers/default.py.1 | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/controllers/default.py.1 b/controllers/default.py.1 new file mode 100644 index 0000000..dd10347 --- /dev/null +++ b/controllers/default.py.1 @@ -0,0 +1,36 @@ +import os + +def index(): + if len(request.args): + records = db(db.comment.image_id==request.args[0]).select() + if len(request.args) and len(records): + form = SQLFORM(db.comment, records[0], deletable=True) + else: + form = SQLFORM(db.comment, fields = ['title', 'file', 'creator', 'description']) + if form.accepts(request.vars, session): + response.flash = 'form accepted' + session.file = form.vars.file + redirect(URL(r=request, f='jamiesprogram')) + elif form.errors: + response.flash = 'form has errors' + return dict(form=form) + +def jamiesprogram(): + images = db().select(db.comment.ALL) + for row in images: + db.comment.insert(file=os.system('python applications/turtle_art_images/modules/PngGenerator.py '+URL(request.application,'default','download',args=row.file))) + return dict() + +def imagelist(): + comments = db().select(db.comment.ALL) + return dict(comments=comments) + +def adminpage(): + db.comment.truncate() + redirect('index.html') + +def imagetemplate(): + return dict() + +def download(): + return response.download(request, db) |