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

Proper way to use dynamic custom config. #37

Closed
c0per opened this issue Jun 18, 2020 · 2 comments
Closed

Proper way to use dynamic custom config. #37

c0per opened this issue Jun 18, 2020 · 2 comments

Comments

@c0per
Copy link

c0per commented Jun 18, 2020

I want to use some custom init in dropzone. I can only come up with only one bad way.
Since Jinja doesn't support statements (if, for) in {{ dropzone.config(custom_init = '') }} because it's a variable, I have to put up some js code using python in Flask view functions.
Any better way?

@greyli
Copy link
Member

greyli commented Jun 19, 2020

Actually, you can set the variable before pass it to custom_init in Jinja with {% set %}. What's your JS code look like?

@c0per
Copy link
Author

c0per commented Jun 19, 2020

Ah I see.
It's some js preloading images already stored on server, when editing images for a specific item.

btw I'm starting to use Flask based on your book.
Keep up the great works. It's a good book for beginners.

@c0per c0per closed this as completed Jun 19, 2020
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

2 participants