Attribute not found. 'Table' object has no attribute 'type'

19 views
Skip to first unread message

Yebach

unread,
Sep 8, 2017, 8:00:59 AM9/8/17
to web2py-users
Hello

when I try to create a left join between two tables I get an error 

Attribute not found.
'Table' object has no attribute 'type'

I have lots of left joins in my code and this is the first time I am experiencing this kind of error.

Any ideas 

my query:

workers_infos = db((query_wi)&(db.workers_info.wi_organization == org) &
(db.workers_info.wi_worker.belongs(set(workers_id)))).select(db.workers_info.id,
db.workers_info.wi_date,
db.workers_info.wi_get_info,
db.workers_info.wi_hour,
db.workers_info.wi_vacation,
db.workers_info.wi_worker,
db.workers_info,
db.workers_info.wi_vacation_past,
db.workers.id, db.workers.w_day_obligation,
db.workers.w_work_type,
db.workers.w_hour_formula,
left=db.workers.on(db.workers.id==db.workers_info.wi_worker)
).as_list()


Anthony

unread,
Sep 8, 2017, 8:31:45 AM9/8/17
to web2py-users
workers_infos = db((query_wi)&(db.workers_info.wi_organization == org) &
(db.workers_info.wi_worker.belongs(set(workers_id)))).select(db.workers_info.id,
db.workers_info.wi_date,
db.workers_info.wi_get_info,
db.workers_info.wi_hour,
db.workers_info.wi_vacation,
db.workers_info.wi_worker,
db.workers_info,

Probably because you have db.workers_info (a Table) where you should instead have a field.

In the future, be sure to show the full traceback.

Anthony
Reply all
Reply to author
Forward
0 new messages