How to populate my WTForm variables?
问题 I'm enabling a function that can edit an entity. I want to populate the form with the variables from the datastore. How can I do it? My code doesn't populate the form: if self.request.get('id'): id = int(self.request.get('id')) ad = Ad.get(db.Key.from_path('Ad', id)) im = ad.matched_images editAdForm = AdForm(ad) if str(users.get_current_user()) == str(ad.user) or users.is_current_user_admin(): self.render_jinja('edit', form_url=blobstore.create_upload_url('/addimage'), admin=users.is_current