i've tried to run what you suggested, but still have a problem:
On Modules:
#!/usr/bin/env python
# coding: utf8
from gluon.html import *
from gluon.http import *
from gluon.validators import *
from gluon.sqlhtml import *
# request, response, session, cache, T, db(s)
# must be passed and cannot be imported!
from gluon.tools import *
db = DAL('sqlite://storage.sqlite')
crud = Crud(globals(),db)
def manage(title, table, request):
form = crud.update(table, request.args(1))
table.id.represent = lambda id: A('Edit:', id, _href = URL(args =
(request.args(0), id)))
search, rows = crud.search(table)
return dict(title = title, form = form, search = search, rows = rows)
On Controller :
# coding: utf8
exec('import applications.%s.modules.manage as manage' %
request.application)
reload(manage)
def blog():
title = T('Blog')
table = db.blog
return manage.manage(title, table, request)
i got an error :
Traceback (most recent call last):
File "/home/sugizo/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/home/sugizo/web2py/applications/stevevanchristie/controllers/manage.py"
<http://127.0.0.1:8000/admin/default/edit/stevevanchristie/controllers/manage.py>,
line 4, in <module>
reload(manage)
File "applications/stevevanchristie/modules/manage.py", line 13, in <module>
crud = Crud(globals(),db)
File "/home/sugizo/web2py/gluon/tools.py", line 2671, in __init__
self.settings.delete_next = self.url()
File "/home/sugizo/web2py/gluon/tools.py", line 2659, in url
f=f, args=args, vars=vars)
File "/home/sugizo/web2py/gluon/html.py", line 218, in URL
raise SyntaxError, 'not enough information to build the url'
SyntaxError: not enough information to build the url
did anyone know how to fixed it?
thank you very much