funkybob / django-sniplates

Template snippet libraries for Django
MIT License
57 stars 18 forks source link

Added raw_value variable to form_field context #37

Closed fabioanderegg closed 6 years ago

fabioanderegg commented 8 years ago

This adds the raw_value context variable in the form_field template tag.

Should also help #29.

Example:

{% block DateTimePickerInput %}
    {% reuse "input" field_type="text" value=raw_value|date:"d.m.Y H:i" %}
 {% endblock %}
sergei-maertens commented 8 years ago

This is provided in https://github.com/funkybob/django-sniplates/blob/feature/pluggable-explosives/sniplates/templatetags/sniplates.py#L299

Could you maybe also test this branch and provide feedback so it can be merged asap?

sergei-maertens commented 6 years ago

This is available via the FieldExtractors

https://github.com/funkybob/django-sniplates/blob/ea7b1a616fecb2e2569e0bad80f91805d7c5ea71/sniplates/templatetags/sniplates.py#L286

(yes, old issue indeed, time to close it!)