From b817158f554f7b3342ecfe3ce24d04e91abed3c3 Mon Sep 17 00:00:00 2001 From: James Boisture Date: Tue, 20 Jul 2010 03:15:23 +0000 Subject: The initial commit of the turtleartsite --- (limited to 'errors/127.0.0.1.2010-07-07.13-40-20.6ffe0d95-5460-4e2c-93e2-86ead95e02cb') diff --git a/errors/127.0.0.1.2010-07-07.13-40-20.6ffe0d95-5460-4e2c-93e2-86ead95e02cb b/errors/127.0.0.1.2010-07-07.13-40-20.6ffe0d95-5460-4e2c-93e2-86ead95e02cb new file mode 100644 index 0000000..d9a6dc5 --- /dev/null +++ b/errors/127.0.0.1.2010-07-07.13-40-20.6ffe0d95-5460-4e2c-93e2-86ead95e02cb @@ -0,0 +1,17 @@ +(dp1 +S'output' +p2 +S'' +sS'layer' +p3 +S'/home/jboisture/Desktop/web2py/applications/turtlesite/controllers/default.py' +p4 +sS'code' +p5 +S'import os\n\ndef index():\n if "page" in request.vars.keys(): page = int(request.vars["page"]) - 1\n else: page = 0\n table = []\n comments = db().select(db.comment.ALL)\n i = 0\n row = []\n count = 0\n for comment in comments:\n if count >= page * 12 and page*12+12 > count:\n if i == 4:\n table.append(row)\n row = []\n i = 0\n i += 1\n row.append(comment)\n count += 1\n table.append(row)\n pages = count / 12\n if count%12 > 0: pages += 1\n page += 1\n return dict(comments=table, pages=pages, page=page)\n\ndef profile():\n if "user" in request.vars.keys(): user = request.vars["user"]\n else: redirect(URL(r=request, f=\'index\')) \n if "page" in request.vars.keys(): page = int(request.vars["page"]) - 1\n else: page = 0\n table = []\n user_pics = []\n comments = db().select(db.comment.ALL)\n for comment in comments:\n if comment.creator == user:\n print user, comment.creator\n user_pics.append(comment)\n i = 0\n row = []\n count = 0\n print page\n for comment in user_pics:\n if count >= page * 12 and page*12+12 > count:\n if i == 4:\n table.append(row)\n row = []\n i = 0\n i += 1\n row.append(comment)\n count += 1\n table.append(row)\n pages = count / 12\n if count%12 > 0: pages += 1\n page += 1\n print table\n return dict(comments=table, pages=pages, page=page, user=user)\n\ndef upload():\n form = SQLFORM(db.comment, fields = [\'title\', \'file\', \'newimage\', \'description\'])\n if form.accepts(request.vars, session):\n session.new_image_title = form.vars.title\n print auth.user.username\n db(db.comment.title==session.new_image_title).update(creator = auth.user.username)\n redirect(URL(r=request, f=\'index\')) \n return dict(form=form)\n\n\ndef image():\n comments = db().select(db.comment.ALL)\n title = request.vars["title"].replace(\'*\',\' \')\n print title\n for comment in comments:\n if comment.title == title:\n real_comment = comment\n return dict(comment = real_comment)\n \n \ndef testimage():\n\treturn db(db.comment.title=="hellotest")\n\ndef user(): \n return dict(form=auth())\n\t\n\ndef adminpage():\n db.comment.truncate()\n redirect(\'index.html\')\n \ndef download():\n return response.download(request, db)\n\nresponse._vars=response._caller(user)\n' +p6 +sS'traceback' +p7 +S'Traceback (most recent call last):\n File "/home/jboisture/Desktop/web2py/gluon/restricted.py", line 178, in restricted\n exec ccode in environment\n File "/home/jboisture/Desktop/web2py/applications/turtlesite/controllers/default.py", line 92, in \n File "/home/jboisture/Desktop/web2py/gluon/globals.py", line 96, in \n self._caller = lambda f: f()\n File "/home/jboisture/Desktop/web2py/applications/turtlesite/controllers/default.py", line 82, in user\n return dict(form=auth())\n File "/home/jboisture/Desktop/web2py/gluon/tools.py", line 966, in __call__\n return self.register()\n File "/home/jboisture/Desktop/web2py/gluon/tools.py", line 1502, in register\n onvalidation=onvalidation):\n File "/home/jboisture/Desktop/web2py/gluon/sqlhtml.py", line 876, in accepts\n onvalidation,\n File "/home/jboisture/Desktop/web2py/gluon/html.py", line 1452, in accepts\n status = self._traverse(status)\n File "/home/jboisture/Desktop/web2py/gluon/html.py", line 480, in _traverse\n newstatus = c._traverse(status) and newstatus\n File "/home/jboisture/Desktop/web2py/gluon/html.py", line 480, in _traverse\n newstatus = c._traverse(status) and newstatus\n File "/home/jboisture/Desktop/web2py/gluon/html.py", line 480, in _traverse\n newstatus = c._traverse(status) and newstatus\n File "/home/jboisture/Desktop/web2py/gluon/html.py", line 480, in _traverse\n newstatus = c._traverse(status) and newstatus\n File "/home/jboisture/Desktop/web2py/gluon/html.py", line 487, in _traverse\n newstatus = self._validate()\n File "/home/jboisture/Desktop/web2py/gluon/html.py", line 1245, in _validate\n (value, errors) = validator(value)\n File "/home/jboisture/Desktop/web2py/gluon/validators.py", line 156, in __call__\n exec \'__ret__=\' + self.expression in environment\n File "", line 1, in \nNameError: name \'auth_table\' is not defined\n' +p8 +s. \ No newline at end of file -- cgit v0.9.1