Changeset f24c1e758385d50296d1290f716f409882824269
- Timestamp:
- 02/10/12 20:52:14 (4 months ago)
- Children:
- 8dd0fb6a1c035d5d3482b4ea9662f1e8d5724c55
- Parents:
- 8ef6d8b58ae443f7e22d0538602a59ff1ad5f710
- git-committer:
- Paul Winkler <slinkp@…> (02/10/12 20:52:14)
- File:
-
- 1 edited
-
ebpub/ebpub/db/templatetags/eb.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ebpub/ebpub/db/templatetags/eb.py
r17bfd5 rf24c1e 73 73 """ 74 74 Get singular or plural name of a schema, depending on 'value'. 75 76 Eg. {% schema_plural_name schema 3 %} --> Restaurant Inspections 75 Example:: 76 77 {% schema_plural_name schema 3 %} --> Restaurant Inspections 77 78 {% schema_plural_name schema 1 %} --> Restaurant Inspection 78 79 … … 88 89 ensure sorts always end up the same. 89 90 90 Example: 91 {% for item in itemlist|safe_id_sort %} ... {% endfor %} 91 Example:: 92 93 {% for item in itemlist|safe_id_sort %} ... {% endfor %} 94 92 95 """ 93 96 var_resolve = template.Variable(arg).resolve … … 172 175 Puts get_metro() into the context as METRO> 173 176 174 Example: {% get_metro %} 177 Examples:: 178 179 {% get_metro %} 175 180 """ 176 181 return GetMetroNode() … … 193 198 """ 194 199 Puts a newsitem with the given ID in the context with the given 195 variable name 196 197 {% get_newsitem some_id as my_item %}198 {% get_newsitem '23' as my_other_item %}200 variable name. Examples:: 201 202 {% get_newsitem some_id as my_item %} 203 {% get_newsitem '23' as my_other_item %} 199 204 """ 200 205 bits = token.split_contents() … … 224 229 context variable. 225 230 226 Example: 227 {% get_more_recent_newsitem [newsitem] [item_list] as [context_var] %} 231 Examples:: 232 233 {% get_more_recent_newsitem [newsitem] [item_list] as [context_var] %} 228 234 """ 229 235 bits = token.split_contents() … … 260 266 def do_get_newsitem_list_by_attribute(parser, token): 261 267 """ 262 268 Get a list of NewsItems with a given attribute value. 263 269 Syntax: 264 270 {% get_newsitem_list_by_attribute [schema_id] [newsitem_id_to_ignore] [att_name]=[value_or_var_containing_value] as [context_var] %} 265 271 266 Example: 272 Example:: 267 273 {% get_newsitem_list_by_attribute schema.id newsitem.id business_id=attributes.business_id as other_licenses %} 268 274 … … 314 320 optionally grouped by schema. 315 321 316 Examples: 317 318 {% newsitem_list_by_schema newsitem "ungrouped" %}319 {% newsitem_list_by_schema newsitem_list %}322 Examples:: 323 324 {% newsitem_list_by_schema newsitem "ungrouped" %} 325 {% newsitem_list_by_schema newsitem_list %} 320 326 321 327 """
Note: See TracChangeset
for help on using the changeset viewer.
