Please replace

import applications.tred.modules.newick as newick
reload(newick)

with

newick=local_import('newick',force=True)

for portability

On 12 Lug, 13:21, "topher.baron" <[email protected]> wrote:
> An ajax request I'm making is erroring on the server with in a place
> that it shouldn't.
>
> Here is the ticket :
>
> Traceback (most recent call last):
>   File "gluon/main.py", line 508, in wsgibase
>   File "gluon/main.py", line 206, in serve_controller
>   File "gluon/compileapp.py", line 435, in run_controller_in
> TypeError: 'NoneType' object is not callable
>
> Here is the controller method that is called :
>
> def addNewick():
>
>     tree = None
>
>     try:
>         import applications.tred.modules.newick as newick
>         reload(newick)
>         tree = newick.parse( request.vars.newickString )
>     except:
>         return 'parseError'
>
>     import datetime
>
>     treeId = db.tree.insert( name = request.vars.newickName,
>                              comments = request.vars.newickComment,
>                              creationDate = datetime.datetime.now() )
>
>     db.sourceTreeMapping.insert( user_id = auth.user.user_id,
> sourceTree = treeId )
>
>     insertTreeNodes( { 'tree': tree, 'treeId': treeId } )
>
>     return treeId
>
> I've placed debugging lines throughout the function - all are printed,
> so I'm guessing the error occurs after the return statement and
> somewhere in the web2py framework
>
> Any suggestions ?

Reply via email to