Skip to content

Instantly share code, notes, and snippets.

@rg3915
Created March 31, 2016 14:39
Show Gist options
  • Save rg3915/8bc6aa47f579aea533c34241362dad65 to your computer and use it in GitHub Desktop.
Save rg3915/8bc6aa47f579aea533c34241362dad65 to your computer and use it in GitHub Desktop.
Return information in mouse over on html.
# /templatetags/core_tags.py
from django import template
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter
def teste(value, arg):
result = '<b title="%s">%s</b>' % (arg, value)
return mark_safe(result)
# templates.html
<td>{{ person.email|teste:person.full_name }}</td>
# O title retorna uma informação em mouse over.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment