View Single Post
Old 07-03-2021, 01:44 PM   #128
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
On a non-fanfiction book with an undefined ccount this displays as "None." If I switch to non-raw field it becomes blank instead.
I don't mind it here, but why does raw field result in "none" instead of blank?

Actually I just realized I could probably remove the second elif statement and combine it with the third with a != compare op...
$$#x is equivalent to raw_field('#x'), which returns 'None' if the value is undefined. If you don't want that then use raw_field('#x', default) where default is whatever you want to see if the value isn't defined. In your case I think you want default to be ''.

EDIT: BTW: raw_field() is useful where the field is formatted in its column definition with characters so that the displayed value is no longer a number. The raw_field() function returns the underlying number, not the formatted one.

Last edited by chaley; 07-03-2021 at 01:49 PM.
chaley is offline   Reply With Quote