Skip to content

Instantly share code, notes, and snippets.

@nathanborror
Created April 16, 2009 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanborror/96627 to your computer and use it in GitHub Desktop.
Save nathanborror/96627 to your computer and use it in GitHub Desktop.
@register.filter
def gt(value, arg):
"Returns a boolean of whether the value is greater than the argument"
return value > int(arg)
@register.filter
def lt(value, arg):
"Returns a boolean of whether the value is less than the argument"
return value < int(arg)
@register.filter
def gte(value, arg):
"Returns a boolean of whether the value is greater than or equal to the argument"
return value >= int(arg)
@register.filter
def lte(value, arg):
"Returns a boolean of whether the value is less than or equal to the argument"
return value <= int(arg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment