alex / alex/django-templatetag-sugar

Multiple Optional objects

Open
#6 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
212
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Having more then one Optional Object fails parsing the parameters.

```
@tag(register, [Constant('as'), Name(), Optional([Constant('for'), Variable()]), Optional([Constant('count'), Variable()])])
def get_tagcloud(context, asvar, forvar=None, countvar=None):
```

I think the problem lies inside the **call** method of the Parser Class, which assumes that all parameters are present in the order they are defined.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.