Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Django Placeholder Template Tag
from django.template import Library
import re
register = Library()
def placeholder(value, token):
value.field.widget.attrs["placeholder"] = token
return value
register.filter(placeholder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment