3

I have a question regarding how to handle datastore data coming from a Google App Engine python project with Jinja2 templating for use in a custom Polymer element.

I am using the simple getting started demo on the Polymer website. I have successfully transferred that existing project to my Google project on App Engine and its working live as I want. I am now attempting to use, with polymer, the values passed from my server via the Jinja2 template method; so I can drop in my Datastore query using {{ stuff }}.

However I noticed that the scope of this data is not reaching the imported files of my Polymer elements. So my custom polymer elements cant see these objects being passed from the server, but the main page which is loaded as the template can use them fine as expected.

What is the correct way to handle passing Datastore into polymer when on app engine? It seems a waste to create a post-service like in the tutorial when I have already queried for the client all my info via python and Datastore and passed it in via templating?

SimonJ
  • 21,076
  • 1
  • 35
  • 50
DMTishler
  • 501
  • 1
  • 6
  • 12

1 Answers1

0

Now that polymer is focusing on single page application(SPA) format, this question has become sort of depreciated as using Jinja2 templating and something like the Polymer Starter Kit brings up other issues of url handling.

In either case, I created simple functions on the App Engine python side to allow me to post/get json objects from the server to some simple javascript. I used the web component iron-ajax to handle the firing of the api calls from the polymer pages.

DMTishler
  • 501
  • 1
  • 6
  • 12