Ticket #622: isnull.diff

File isnull.diff, 631 bytes (added by anonymous, 19 years ago)
  • defaultfilters.py

     
    330330###################
    331331
    332332def default(value, arg):
    333     "If value is unavailable, use given default"
     333    "If value is false, use given default"
    334334    return value or arg
    335335
     336def isnull(value, arg):
     337    "If value is unavailable, use given default"
     338    if value == None:
     339        return arg
     340    return value
     341
     342
    336343def divisibleby(value, arg):
    337344    "Returns true if the value is devisible by the argument"
    338345    return int(value) % int(arg) == 0
Back to Top