Changeset 7647
- Timestamp:
- 06/15/08 22:35:50 (5 months ago)
- Files:
-
- django/trunk/docs/templates_python.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/templates_python.txt
r7294 r7647 1060 1060 Although you can pass any number of arguments to a template tag using 1061 1061 ``token.split_contents()``, the arguments are all unpacked as 1062 string literals. A little more work is required in order to dynamic content (a1063 template variable) to a template tag as an argument.1062 string literals. A little more work is required in order to pass dynamic 1063 content (a template variable) to a template tag as an argument. 1064 1064 1065 1065 While the previous examples have formatted the current time into a string and … … 1170 1170 1171 1171 @register.simple_tag 1172 def current_time( token):1172 def current_time(format_string): 1173 1173 ... 1174 1174 1175 1175 A couple of things to note about the ``simple_tag`` helper function: 1176 1176 1177 * Checking for the required number of arguments, etc, has already been 1177 1178 done by the time our function is called, so we don't need to do that.
