Il 08/07/16 08:54, Kenneth ha scritto: > Hello, > > I fetch a number on records from the database and show it on the > screen. Is there a way to not print the text None for fields that are > in the state None. I could use if field != None but I'd rather not use > IF if there is an other way. I would say that it depends on what result you want to accieve: 1. You don't want results with no values for the field in object, in that case it's better to cat out them with an adequate query (i.e.: ...&(myfield!=None)); 2. You want to see "" (empty string) instead of "None" for the records that has no value for the field in object, in that case you can fix the represent function of the field with something like field.represent = lambda v: "" if v is None else v;
I hope it could help. Cheers Manuele > > > Kenneth > > -- > 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 > <mailto:web2py+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout. -- 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.