[web2py] Re: How to display the value of a reference field, instead of the id in sqlform.grid part 2

2013-12-02 Thread Gael Princivalle
Ok, I've found how doing it. I've made this change in my fields: fields = (db.enquiries.enquiry_date, db.products.code, db.enquiries.note) Il giorno lunedì 2 dicembre 2013 16:17:37 UTC+1, Gael Princivalle ha scritto: Hi. Sorry about that, but I'm gone ask for something already asked before,

[web2py] Re: how to display the value of a reference field, instead of the id in sqlform.grid

2013-05-03 Thread Nguyen Minh Tuan
Hi Anthony, This is seem not work in case self reference. Ex : Field('boss', 'reference auth_user') How can I solve in this situation? Thanks, On Monday, October 8, 2012 9:17:49 AM UTC+7, dave wrote: Thank you very much, I did not see this in the documentation and yes it would be nice

[web2py] Re: how to display the value of a reference field, instead of the id in sqlform.grid

2013-05-03 Thread Anthony
What doesn't work exactly? With self references, you have to define your own validator and represent attribute because the table doesn't yet exist at the time the Field is created. Anthony On Friday, May 3, 2013 12:22:56 PM UTC-4, Nguyen Minh Tuan wrote: Hi Anthony, This is seem not work

[web2py] Re: how to display the value of a reference field, instead of the id in sqlform.grid

2012-10-07 Thread Anthony
How is your test1 field defined? On Sunday, October 7, 2012 3:26:31 AM UTC-4, dave wrote: grid = SQLFORM.grid(query, args=[request.args(0)], fields=[db.auth_user.test0, db.auth_user.test1,

[web2py] Re: how to display the value of a reference field, instead of the id in sqlform.grid

2012-10-07 Thread dave
auth.settings.extra_fields['auth_user']= [ #Field('name', requires=IS_NOT_EMPTY()), . . . Field('test1', 'reference ranking', requires=IS_IN_DB(db, 'ranking.id', '%(name)s')), . . . On Sunday, October 7, 2012 7:37:03 AM UTC-7, Anthony wrote: How is your test1 field defined?

[web2py] Re: how to display the value of a reference field, instead of the id in sqlform.grid

2012-10-07 Thread Anthony
If you do: Field('test1', 'reference ranking') and then make sure the format attribute of the ranking table is set to '%(name)s', then the test1 field will automatically get the IS_IN_DB validator you have explicitly defined below, and it will automatically get a represent attribute

[web2py] Re: how to display the value of a reference field, instead of the id in sqlform.grid

2012-10-07 Thread dave
Thank you very much, I did not see this in the documentation and yes it would be nice if it is consistent with your expectation On Sunday, October 7, 2012 6:25:09 PM UTC-7, Anthony wrote: If you do: Field('test1', 'reference ranking') and then make sure the format attribute of the ranking