Ticket #622: isnull.diff
File isnull.diff, 631 bytes (added by , 19 years ago) |
---|
-
defaultfilters.py
330 330 ################### 331 331 332 332 def default(value, arg): 333 "If value is unavailable, use given default"333 "If value is false, use given default" 334 334 return value or arg 335 335 336 def isnull(value, arg): 337 "If value is unavailable, use given default" 338 if value == None: 339 return arg 340 return value 341 342 336 343 def divisibleby(value, arg): 337 344 "Returns true if the value is devisible by the argument" 338 345 return int(value) % int(arg) == 0