Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-29 Thread Muhammad Atif Ayaz
Thank you very much! On Fri, Jan 29, 2021 at 9:14 AM valq...@gmail.com wrote: > db.table['fieldname'] > > > четверг, 28 января 2021 г. в 07:31:04 UTC+3, at: > >> It gives error: `*AttributeError('str' object has no attribute >> 'tablename')*` >> >> The reason is that the field names are in strin

Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-28 Thread valq...@gmail.com
db.table['fieldname'] четверг, 28 января 2021 г. в 07:31:04 UTC+3, at: > It gives error: `*AttributeError('str' object has no attribute > 'tablename')*` > > The reason is that the field names are in string format not in > db.tablename.fieldname format > > > On Wed, Jan 27, 2021 at 6:30 PM Jim

Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-27 Thread Muhammad Atif Ayaz
It gives error: `*AttributeError('str' object has no attribute 'tablename')* ` The reason is that the field names are in string format not in db.tablename.fieldname format On Wed, Jan 27, 2021 at 6:30 PM Jim Steil wrote: > What is wrong with using the example you provided? > > -Jim > > > On Tu

Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-27 Thread Jim Steil
What is wrong with using the example you provided? -Jim On Tue, Jan 26, 2021 at 10:45 PM Muhammad Atif Ayaz wrote: > Thank you Jim, it works. > > Do you think a way that can help dynamically making a list of all fields > of a table and then we can remove specific fields from it. > Like the fol

Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-26 Thread Muhammad Atif Ayaz
Thank you Jim, it works. Do you think a way that can help dynamically making a list of all fields of a table and then we can remove specific fields from it. Like the following which produces the required list but in the desired data-type: fields = [fld for fld in db.engagement.fields if fld!='toke

[web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-26 Thread Jim S
Can you try with the field in the format: db.tablename.fieldname ex: fields = [db.engagement.id, db.engagement.name] -Jim On Monday, January 25, 2021 at 11:45:49 PM UTC-6 at wrote: > Here is the code: > `fields=['id', 'name']` > `grid = SQLFORM.grid(db.engagement, fields=fields)` > > Error: