Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will not display any graphs #35

Open
BlogBlocks opened this issue Jul 2, 2018 · 5 comments
Open

Will not display any graphs #35

BlogBlocks opened this issue Jul 2, 2018 · 5 comments

Comments

@BlogBlocks
Copy link

BlogBlocks commented Jul 2, 2018

This is the error I got:

def join_path(self, template, parent):
\n in template()
\nTemplateAssertionError: no filter named 'tojson'\n

@glynnbird
Copy link
Member

I'm keen to reproduce the error you have spotted but I could do with ore detail. Can you post a minimal block of code that generates the error?

@BlogBlocks
Copy link
Author

BlogBlocks commented Jul 2, 2018

This will fix it .
`pallets/jinja@7b4393d

I was using pixiedust_node and it would not make a graph stating 'to_json' did not exist.
FYI - a window pops up and you must define the graph / plot parameters. It works fine
on Ubuntu 16.04 python2.7 jinja2 VERSION 2.8

in the file ..../jinja2/filters.py
Create the def do_json(value): function and add to right above the 'def do_round(value, function)'

Example:

def do_json(value):
"""A filter that outputs Python objects as JSON"""
import json
return json.dumps(value)

-- this bottom function exists --- place do_json above it --
def do_round(value, precision=0, method='common'):
"""Round the number to a given precision. The first
parameter specifies the precision (default is 0),

Then add ( 'to_json': do_json, ) to the definitions on the bottom of the page:

Example:
'wordcount': do_wordcount,
'wordcount': do_wordcount,
'wordwrap': do_wordwrap,
'wordwrap': do_wordwrap,
'xmlattr': do_xmlattr,
'xmlattr': do_xmlattr,
'to_json': do_json,
`
What I stated above was the exact error I recieved:

@DTAIEB
Copy link
Member

DTAIEB commented Jul 2, 2018

@BlogBlocks You may have an old version of JinJa2. Can you try updating it:

!pip install -U jinja2

@ptitzler
Copy link
Contributor

ptitzler commented Jul 9, 2018

Upgrading to a more recent version of Jinja2 (2.9.6) fixed the issue for me when I ran into it a little while ago.

@BlogBlocks
Copy link
Author

I got it working with jinja2 VERSION 2.8
I just had to define 'to_json': do_json,
in filter.py
by adding it to the end of the file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants