diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-02-25 05:50:24 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-02-25 05:50:24 +0000 |
| commit | 8f1fb6da3a2eaae0e8c2351266900c1ae9d36403 (patch) | |
| tree | f26d97b57f425ac38fb54c69f8bf6171514c2903 /docs | |
| parent | 67e0248806e8adc03ddd81e9543f77b540ed1673 (diff) | |
newforms-admin: Merged to [4563]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4565 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/templates_python.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/templates_python.txt b/docs/templates_python.txt index a6b565ed5c..5dd8e4fde0 100644 --- a/docs/templates_python.txt +++ b/docs/templates_python.txt @@ -654,6 +654,18 @@ decorator instead:: If you leave off the ``name`` argument, as in the second example above, Django will use the function's name as the filter name. +Template filters which expect strings +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If you are writing a template filter which only expects a string as the first +argument, you should use the included decorator ``stringfilter`` which will convert +an object to it's string value before being passed to your function:: + + from django import template + + @template.stringfilter + def lower(value): + return value.lower() + Writing custom template tags ---------------------------- |
