2015-06-02 18:27 GMT+01:00 Emil Stenström <[email protected]>: > That's a problem that I hadn't thought about. I was hoping that querysets > where always serializable, but I didn't think of datetime and decimal (and > others), which people might send to their views. Are there other pitfalls > here? Maybe this could just be else that people would have to change to use > the new template backend.
No matter what you do, if you're doing isomorphic rendering on the server and client side, you need to serialize all context data to the common denominator, that is, JSON. On the Python side, this doesn't have to be encoded as JSON; you can keep an equivalent representation with Python dicts, lists, strings and numbers. However you can't keep objects and call their methods in templates, like Django on Jinja2 templates often do. This is not a bad thing. There are advantages to pre-computing explicitly all data you need in before you start rendering the template. All I'm saying is that we must be aware of this new constraint because we aren't used to it until now. -- Aymeric. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CANE-7mUZLZX4f5Z%3DT%2BSU97hYkprOUK2YXoXxD%3DkOKBA%3DtRic6A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
