Re: [web2py] Re: Rendering null values in SQLFORM.grid
You should be able to use field.represent to do that. If the value is None, then show something else like ''. Regards Johann On 30 March 2015 at 14:54, JorgeH jorgeh...@gmail.com wrote: I am dealing with the same issue these days. Client told me to remove all those 'None' fields. On Monday, March 30, 2015 at 7:36:51 AM UTC-5, Mirek Zvolský wrote: null value is not an empty string That's true. However we make applications for customers and they aren't interested to see a technical value 'None', but the language translated value (something like T(None)) or symbol for None content. So I think it would be better if we have parameter how to represent None values elsewhere. Mi Dne pondělí 10. června 2013 17:32:33 UTC+2 Niphlod napsal(a): The second one you said (i.e. altering the default repr for None values). From a theoretical standpoint, a null value is not an empty string. If your app doesn't care for the difference, set a default='' on the interested fields. Il giorno lunedì 10 giugno 2013 15:42:21 UTC+2, Lamps902 ha scritto: If there's a NULL value in my postgresql DB, SQLFORM.grid renders it as None. Is it there something that can be done globally for an SQLFORM.grid that would simply make it display all NULL values as an empty string (i.e. not display anything in the grid for NULLs), or does that have to be determined individually for every field by setting the respective field's *represent *parameter? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Rendering null values in SQLFORM.grid
null value is not an empty string That's true. However we make applications for customers and they aren't interested to see a technical value 'None', but the language translated value (something like T(None)) or symbol for None content. So I think it would be better if we have parameter how to represent None values elsewhere. Mi Dne pondělí 10. června 2013 17:32:33 UTC+2 Niphlod napsal(a): The second one you said (i.e. altering the default repr for None values). From a theoretical standpoint, a null value is not an empty string. If your app doesn't care for the difference, set a default='' on the interested fields. Il giorno lunedì 10 giugno 2013 15:42:21 UTC+2, Lamps902 ha scritto: If there's a NULL value in my postgresql DB, SQLFORM.grid renders it as None. Is it there something that can be done globally for an SQLFORM.grid that would simply make it display all NULL values as an empty string (i.e. not display anything in the grid for NULLs), or does that have to be determined individually for every field by setting the respective field's *represent *parameter? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Rendering null values in SQLFORM.grid
I am dealing with the same issue these days. Client told me to remove all those 'None' fields. On Monday, March 30, 2015 at 7:36:51 AM UTC-5, Mirek Zvolský wrote: null value is not an empty string That's true. However we make applications for customers and they aren't interested to see a technical value 'None', but the language translated value (something like T(None)) or symbol for None content. So I think it would be better if we have parameter how to represent None values elsewhere. Mi Dne pondělí 10. června 2013 17:32:33 UTC+2 Niphlod napsal(a): The second one you said (i.e. altering the default repr for None values). From a theoretical standpoint, a null value is not an empty string. If your app doesn't care for the difference, set a default='' on the interested fields. Il giorno lunedì 10 giugno 2013 15:42:21 UTC+2, Lamps902 ha scritto: If there's a NULL value in my postgresql DB, SQLFORM.grid renders it as None. Is it there something that can be done globally for an SQLFORM.grid that would simply make it display all NULL values as an empty string (i.e. not display anything in the grid for NULLs), or does that have to be determined individually for every field by setting the respective field's *represent *parameter? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Rendering null values in SQLFORM.grid
Since I have time and integer fields I cannot set default to ''. What do you suggest for a solution? On Monday, June 10, 2013 5:32:33 PM UTC+2, Niphlod wrote: The second one you said (i.e. altering the default repr for None values). From a theoretical standpoint, a null value is not an empty string. If your app doesn't care for the difference, set a default='' on the interested fields. Il giorno lunedì 10 giugno 2013 15:42:21 UTC+2, Lamps902 ha scritto: If there's a NULL value in my postgresql DB, SQLFORM.grid renders it as None. Is it there something that can be done globally for an SQLFORM.grid that would simply make it display all NULL values as an empty string (i.e. not display anything in the grid for NULLs), or does that have to be determined individually for every field by setting the respective field's *represent *parameter? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Rendering null values in SQLFORM.grid
why not ? the point here is representing something that isn't there as something else (entirely your choice) instead of None. The solution IF THE APP DOESN'T CARE is to set a default. IF THE APP CARES you still have the represent solution, where you can use whatever you want, we've got it as like as . or go look elsewhere. On Tuesday, December 2, 2014 10:07:31 AM UTC+1, Yebach wrote: Since I have time and integer fields I cannot set default to ''. What do you suggest for a solution? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Rendering null values in SQLFORM.grid
The second one you said (i.e. altering the default repr for None values). From a theoretical standpoint, a null value is not an empty string. If your app doesn't care for the difference, set a default='' on the interested fields. Il giorno lunedì 10 giugno 2013 15:42:21 UTC+2, Lamps902 ha scritto: If there's a NULL value in my postgresql DB, SQLFORM.grid renders it as None. Is it there something that can be done globally for an SQLFORM.grid that would simply make it display all NULL values as an empty string (i.e. not display anything in the grid for NULLs), or does that have to be determined individually for every field by setting the respective field's *represent *parameter? Thanks. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Rendering null values in SQLFORM.grid
Thanks for the clarification, Niphlod. On Monday, June 10, 2013 10:32:33 AM UTC-5, Niphlod wrote: The second one you said (i.e. altering the default repr for None values). From a theoretical standpoint, a null value is not an empty string. If your app doesn't care for the difference, set a default='' on the interested fields. Il giorno lunedì 10 giugno 2013 15:42:21 UTC+2, Lamps902 ha scritto: If there's a NULL value in my postgresql DB, SQLFORM.grid renders it as None. Is it there something that can be done globally for an SQLFORM.grid that would simply make it display all NULL values as an empty string (i.e. not display anything in the grid for NULLs), or does that have to be determined individually for every field by setting the respective field's *represent *parameter? Thanks. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.