Skip to content

Commit

Permalink
README updated
Browse files Browse the repository at this point in the history
  • Loading branch information
flosch committed Jul 29, 2014
1 parent f8911a1 commit 1deab40
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 22 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Please use the [issue tracker](https://github.com/flosch/pongo2/issues) if you'r

**Current status/version**: beta ([open issues to first stable release](https://github.com/flosch/pongo2/issues?milestone=1&state=open))

| Topic | Status |
| -----------------------------| -------------------------------------------------------------------------------------- |
| Django version compatiblity: | [1.7](https://docs.djangoproject.com/en/1.7/ref/templates/builtins/) |
| *Missing* **filters**: | none ([hints](https://github.com/flosch/pongo2/blob/master/filters_builtin.go#L3)) |
| *Missing* **tags**: | ifchanged, regroup ([hints](https://github.com/flosch/pongo2/blob/master/tags.go#L4)) |
| Topic | Status |
| ------------------------------------ | -------------------------------------------------------------------------------------- |
| Django version compatiblity: | [1.7](https://docs.djangoproject.com/en/1.7/ref/templates/builtins/) |
| *Missing* (planned) **filters**: | none ([hints](https://github.com/flosch/pongo2/blob/master/filters_builtin.go#L3)) |
| *Missing* (planned) **tags**: | none ([hints](https://github.com/flosch/pongo2/blob/master/tags.go#L4)) |

Please also have a look on the [caveats](https://github.com/flosch/pongo2#caveats) and on the [official add-ons](https://github.com/flosch/pongo2#official).

Expand Down Expand Up @@ -67,7 +67,12 @@ It is *not* done automatically.
### Tags

* **for**: All the `forloop` fields (like `forloop.counter`) are written with a capital letter at the beginning. For example, the `counter` can be accessed by `forloop.Counter` and the parentloop by `forloop.Parentloop`.
* **now**: takes Go's time format (see **date** and **time**-filter)
* **now**: takes Go's time format (see **date** and **time**-filter).

### Misc

* **not in-operator**: You can check whether a map/struct/string contains a key/field/substring by using the in-operator (or the negation of it):
`{% if key in map %}Key is in map{% else %}Key not in map{% endif %}` or `{% if !(key in map) %}Key is NOT in map{% else %}Key is in map{% endif %}`.

# Add-ons, libraries and helpers

Expand Down
4 changes: 2 additions & 2 deletions filters_builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ package pongo2
pprint (reason: python-specific)
static (reason: web-framework specific)
Rethink (not implemented yet):
------------------------------
Reconsideration (not implemented yet):
--------------------------------------
force_escape (reason: not yet needed since this is the behaviour of pongo2's escape filter)
safeseq (reason: same reason as `force_escape`)
Expand Down
16 changes: 4 additions & 12 deletions tags.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
package pongo2

/*
Missing built-in tags:
----------------------
not in operator
ifchanged
Grouping on other properties
Incomplete:
/* Incomplete:
-----------
verbatim (only the "name" argument is missing for verbatim)
Rethink:
--------
Reconsideration:
----------------
debug (reason: not sure what to output yet)
regroup (reason: maybe too python-specific; not sure how useful this would be in Go)
regroup / Grouping on other properties (reason: maybe too python-specific; not sure how useful this would be in Go)
Following built-in tags wont be added:
--------------------------------------
Expand Down
9 changes: 8 additions & 1 deletion template_tests/expressions.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@ float comparison
remainders
{{ (simple.number+7)%7 }}
{{ (simple.number+7)%7 == 0 }}
{{ (simple.number+7)%6 }}
{{ (simple.number+7)%6 }}

in/not in
{{ 5 in simple.intmap }}
{{ 2 in simple.intmap }}
{{ 7 in simple.intmap }}
{{ !(5 in simple.intmap) }}
{{ not(7 in simple.intmap) }}
9 changes: 8 additions & 1 deletion template_tests/expressions.tpl.out
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@ True
remainders
0
True
1
1

in/not in
True
True
False
False
True

0 comments on commit 1deab40

Please sign in to comment.