Ron
Ron

Reputation: 137

Code-completion support for Django template language in Pycharm

In the template files code-completion works well for html tags and for adding matching {%,

What I want is for eg: if I type blog. and Ctrl + Space, it should show me the options like blog_title,blog_author etc, that are associated with blog.

Is this possible at all?

Upvotes: 1

Views: 279

Answers (2)

ejah
ejah

Reputation: 121

It is possible if you register your own template tags with explicit name in your code. Example: register.tag ("page_attribute", PageAttribute) See also: https://github.com/divio/django-cms/issues/3878 where the same thing came up. PyCharm will recognize that and do as you asked.

Upvotes: 0

aumo
aumo

Reputation: 5574

I do not think it is possible as PyCharm has no knowledge of the type of objects you pass as context to the template. It could infer it from the view where the template is used but we are not there yet.

Upvotes: 1

Related Questions