Paul, sorry about that.  I know what the problem is, I'll make a new  
patch tonight, and test it myself this time so I don't waste your time  
on it.

-ian

Quoting Paul Johnston <[EMAIL PROTECTED]>:

> Ian,
>
> Thanks for the quick turnaround. I'm afraid it's still not quite
> working! I'll post a brain dump now, then carry on looking at it.
>
> With your first suggestion of adding two lines to my model.py, the app
> now starts correctly, but when I issue a request that accesses the
> database I get a the same error as before.
>
> With your suggested patch I get a different error on startup:
>
> C:\paj\tsrweb>start-tsrweb.py
> Traceback (most recent call last):
>  File "C:\paj\tsrweb\start-tsrweb.py", line 5, in ?
>    import turbogears
>  File "c:\paj\turbogears\turbogears\__init__.py", line 6, in ?
>    from turbogears.controllers import expose, flash, validate, redirect, \
>  File "c:\paj\turbogears\turbogears\controllers.py", line 12, in ?
>    from turbogears import view, database, errorhandling, config
>  File "c:\paj\turbogears\turbogears\database.py", line 54, in ?
>    bind_meta_data()
>  File "c:\paj\turbogears\turbogears\database.py", line 49, in bind_meta_data
>    get_engine()
>  File "c:\paj\turbogears\turbogears\database.py", line 39, in get_engine
>    dburi = alch_args.pop('dburi')
> KeyError: 'pop(): dictionary is empty'
>
> BTW, I realise that ActiveMapper is now deprecated, but we need to keep
> backwards compatibility for a little while yet.
>
> Paul
>
>
> Ian Charnas wrote:
>
>> Paul, I made a new patch (against the latest rev 3004) that should fix
>> this problem.  Can you try applying this patch and see if your code
>> runs OK?  I cannot test it right now because turbogears/controllers.py
>> seems to have incorrect indentation in the expose() method (someone
>> put in tabs instead of spaces, shame shame!)
>>
>> Just download the multiple_databases2.diff patch from the ticket:
>> http://trac.turbogears.org/ticket/1380
>> and from trunk/ do a:
>> patch -p0 < multiple_databases2.diff
>> or the appropriate thing on your OS.
>>
>> Could you test this soon, and let me know how it goes?
>>
>> many thanks,
>> -Ian Charnas
>>
>>
>> On May 6, 5:55 pm, Paul Johnston <[EMAIL PROTECTED]> wrote:
>>
>>> Hi,
>>>
>>>
>>>> The following was also submitted through trac with a patch:
>>>> http://trac.turbogears.org/ticket/1380
>>>>
>>> Sounds like a good idea, but the current patch breaks my application. I
>>> am using ActiveMapper, and when my code accesses the database at startup
>>> it causes the following exception:
>>>
>>> C:\paj\tsrweb>start-tsrweb.py
>>> Traceback (most recent call last):
>>> File "C:\paj\tsrweb\start-tsrweb.py", line 26, in ?
>>>   from tsrweb.controllers import Root
>>> File "C:\paj\tsrweb\tsrweb\controllers.py", line 12, in ?
>>>   from formdefs import *
>>> File "C:\paj\tsrweb\tsrweb\formdefs.py", line 111, in ?
>>>   class GT01Fields(WidgetsList):
>>> File "C:\paj\tsrweb\tsrweb\formdefs.py", line 112, in GT01Fields
>>>   month           = ChoiceSelectField('month')
>>> File "c:\paj\turbogears\turbogears\widgets\meta.py", line 143, in
>>> widget_init
>>>   func(self, *args, **kw)
>>> File "C:\paj\tsrweb\tsrweb\widgets.py", line 345, in __init__
>>>   options = extra+[(x.code, str(x)) for x in
>>> Choice.select((Choice.c.field == field) & (Choice.c.userval == False))]
>>> File "c:\python24\lib\site-packages\sqlalchemy\ext\assignmapper.py",
>>> line 7, in do
>>>   return getattr(query, name)(*args, **kwargs)
>>> File "c:\python24\lib\site-packages\sqlalchemy\orm\query.py", line
>>> 319, in select
>>>   return self.select_whereclause(whereclause=arg, **kwargs)
>>> File "c:\python24\lib\site-packages\sqlalchemy\orm\query.py", line
>>> 326, in select_whereclause
>>>   return self._select_statement(statement, params=params)
>>> File "c:\python24\lib\site-packages\sqlalchemy\orm\query.py", line
>>> 939, in _select_statement
>>>   return self.execute(statement, params=params, **kwargs)
>>> File "c:\python24\lib\site-packages\sqlalchemy\orm\query.py", line
>>> 843, in execute
>>>   result = self.session.execute(self.mapper, clauseelement, params=params)
>>> File "c:\python24\lib\site-packages\sqlalchemy\orm\session.py", line
>>> 183, in execute
>>>   return self.connection(mapper,
>>> close_with_result=True).execute(clause, params, **kwargs)
>>> File "c:\python24\lib\site-packages\sqlalchemy\orm\session.py", line
>>> 170, in connection
>>>   return self.get_bind(mapper).contextual_connect(**kwargs)
>>> File "c:\python24\lib\site-packages\sqlalchemy\orm\session.py", line
>>> 272, in get_bind
>>>   raise exceptions.InvalidRequestError("Could not locate any Engine
>>> bound to mapper '%s'" % str(mapper))
>>> sqlalchemy.exceptions.InvalidRequestError: Could not locate any Engine
>>> bound to mapper 'Mapper|Choice|choice'
>>>
>>> Paul
>>>
>>
>>
>>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to