Not trunk. I am using:
Version 2.00.0 (2012-06-18 17:07:27) dev
The funny thing is that, accessing other tables in the same controller does
not raise an exception.
For example, this works fine:
form = SQLFORM(db['agent'])
'agent' being my old agent table (I am migrating the agents to the
auth_user table).
On Wednesday, August 22, 2012 12:49:30 AM UTC+2, Massimo Di Pierro wrote:
>
> Are you using trunk. We have been messing up with it a lot in the last 3
> days. Try it again now.
>
> On Tuesday, August 21, 2012 5:41:03 PM UTC-5, Daniel Gonzalez wrote:
>>
>> Hi,
>>
>> I have defined so my authorization table (db.py):
>>
>> # Use the authorization table for agents
>> agent_table = auth.settings.table_user_name
>> db.define_table(
>> agent_table,
>> Field('email', unique=True),
>> Field('agent_doc_id', length=128, compute=create_new_agent),
>> Field('password', 'password', length=512,
>> compute=automatic_password,readable
>> =False, label='Password'),
>> format = '%(email)s %(agent_doc_id)s %(password)s')
>>
>>
>> # Add contstraints to the agent table
>> agent = db[agent_table]
>> agent.email.requires = [IS_EMAIL(error_message=auth.messages.
>> invalid_email), IS_NOT_IN_DB(db, '%s.email' % (agent_table))]
>>
>> In one of my controllers I want to access the agents, which are in the
>> auth_user table. I do the following:
>>
>> form = SQLFORM(db[agent_table])
>>
>> I have verified my database (sqlite), and the table is indeed there. But
>> I get the following error:
>>
>> <type 'exceptions.KeyError'> 'auth_user'
>>
>> The errror is happening when accessing db[agent_table] in the controller.
>> Meanwhile, doing the same access in the model file (db.py), works fine.
>> What is going on?
>>
>> Thanks,
>> Daniel
>>
>
--