Hi,
Not sure what is causing this to happen, the select is not using the
table name I have provided:
Tried:
last = db().select(db.distributors.ALL)
and:
last = db().select(db['distributors'].ALL)
Notice I used "distributor*s*"
Traceback (most recent call last):
File "/home/bruce/Development/bossteam_dev/projects/yaw/gluon/restricted.py",
line 204, in restricted
exec ccode in environment
File
"/home/bruce/Development/bossteam_dev/projects/yaw/applications/welcome/controllers/default.py"
<http://127.0.0.1:8000/admin/edit/welcome/controllers/default.py>,
line 272, in <module>
File "/home/bruce/Development/bossteam_dev/projects/yaw/gluon/globals.py",
line 172, in <lambda>
self._caller = lambda f: f()
File
"/home/bruce/Development/bossteam_dev/projects/yaw/applications/welcome/controllers/default.py"
<http://127.0.0.1:8000/admin/edit/welcome/controllers/default.py>,
line 184, in registration
last = db().select(db['distributors'].ALL)
File "/home/bruce/Development/bossteam_dev/projects/yaw/gluon/dal.py",
line 6333, in select
return self.db._adapter.select(self.query,fields,attributes)
File "/home/bruce/Development/bossteam_dev/projects/yaw/gluon/dal.py",
line 1287, in select
return self.parse(rows,self._colnames)
File "/home/bruce/Development/bossteam_dev/projects/yaw/gluon/dal.py",
line 1487, in parse
(rid._table, rid._record) = (db[referee], None)
File "/home/bruce/Development/bossteam_dev/projects/yaw/gluon/dal.py",
line 5113, in __getitem__
return dict.__getitem__(self, str(key))
KeyError: 'distributor'
model:
db.define_table('distributors',
Field('sponsor_id', 'reference distributors', notnull=False),
Field('upline_id', 'reference distributors', notnull=False),
Field('display_name'),
Field('account_id', 'reference user_account'),
Field('access_key')
)
Why is it complaining about distributor? It is searching for distributor
instead of distributors which explains why the key does not exists.
PS: I even deleted and rebuilt the database.
--
--
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com