Modifying Django Inspections / Syntax Checking

I have a problem with the Django syntax checking. It seems to assume quite a lot about the nature of my template tags. In my application I have an extended with tag that allows restricted method calls within templates.

{% tm_with results=report.results(limit=100 sort="-created_at") %}

{% endwith %}

This triggers an error (even when all Django inspections are switched off) saying "Expected %}" at the point of the opening parenthesis. I understand this in most situations parentheses wouldn't appear within a template tag and so this rule should probably apply, however, it is valid in custom ones. So, to my question, is it possible to modify the syntax checking for Django templates to avoid this problem?

Thanks,

Rob

2 comments
Comment actions Permalink

Hello Rob,

There is currently no way to configure the Django template tag parser. Please

file an issue at http://youtrack.jetbrains.net/ and we'll make the parser

more tolerant to custom template tags.

I have a problem with the Django syntax checking. It seems to assume

quite a lot about the nature of my template tags. In my application I

have an extended with tag that allows restricted method calls within

templates.

{% tm_with
> results=report.results(limit=100 sort="-created_at") %}
> 
> {% endwith %}

This triggers an error (even when all Django inspections are switched

off) saying "Expected %}" at the point of the opening parenthesis. I

understand this in most situations parentheses wouldn't appear within

a template tag and so this rule should probably apply, however, it is

valid in custom ones. So, to my question, is it possible to modify the

syntax checking for Django templates to avoid this problem?

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

Hi Rob,

I've created an issue http://youtrack.jetbrains.net/issue/PY-3704

This problem will be fixed soon.

Thanks,

Dmitry

0

Please sign in to leave a comment.