
from .library import Library
from .filters import Filter


register = Library()


@register.filter(name='title')
class TitleFilter(Filter):
    def __rshift__(self, other):
        return str(other).title()


from .library import Library


register = Library()


@register.filter
def title(val):
    return str(val).title()

Convert to new style filter
Convert to new style filter

  
  from .library import Library
- from .filters import Filter
  
  
  register = Library()
  
  
+ @register.filter
+ def title(val):
- @register.filter(name='title')
- class TitleFilter(Filter):
-     def __rshift__(self, other):
-         return str(other).title()
+     return str(val).title()
  
Convert to new style filter
## Code Before:

from .library import Library
from .filters import Filter


register = Library()


@register.filter(name='title')
class TitleFilter(Filter):
    def __rshift__(self, other):
        return str(other).title()

## Instruction:
Convert to new style filter
## Code After:

from .library import Library


register = Library()


@register.filter
def title(val):
    return str(val).title()
