1 2 3 4 5 6 7 8 9 10 | @register.filter
def classname(obj, arg=None):
classname = obj.__class__.__name__.lower()
if arg:
if arg.lower() == classname:
return True
else:
return False
else:
return classname
|
More like this
- Allow any view (probably a generic view) to accept POST variables into extra_context by orblivion 2 years, 7 months ago
- Convert CamelCase to lowercase_with_underscores by jdriscoll 5 years, 4 months ago
- ExprTag - Calculating python expression and saving the result to a variable by limodou 6 years, 3 months ago
- User group template tag by jdriscoll 6 years ago
- Database cleanup by skyjur 2 years, 10 months ago
Comments