Hi yinDojo,
I'm not sure, if I understood your problem.
You have a template like this - lets call it "index.html"
<---
<html>
<body>
<form action="" method="post">
{{form.as_p }}
<input type="submit" name="create" value="Create">
</form>
</body>
</html>
<---
Right??
Then your models.py has to look like this:
<---
import os
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template
class MainHandler(webapp.RequestHandler):
def get(self):
template_values = {
'form.as_p' : '<input type="text" name="first_name"><input
type="text" name="last_name">'
}
path = os.path.join(os.path.dirname(__file__), './index.html')
self.response.out.write(template.render(path, template_values))
def main():
run_wsgi_app(webapp.WSGIApplication([('/', MainHandler)],
debug=True))
if __name__ == '__main__':
main()
-->
Per "self.response.out.write(template.render(path, template_values))"
you take a file path to the template file and a dictionary of values,
and return the rendered text. Take a look to
http://www.djangoproject.com/documentation/0.96/templates/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---