【发布时间】:2016-04-10 02:47:22
【问题描述】:
直到最近,我才能够将数据发布到我的数据存储区(Google App Engine)。我现在添加了 Summernote 所见即所得,现在我不再能够从数据存储中添加/获取数据。您认为问题出在哪里?
Main.py
class About(ndb.Model):
text = ndb.StringProperty()
#object
cv = About()
class MainHandler(webapp2.RequestHandler):
def get(self):
title="Exercise"
cv = About.get_or_insert('6684480941064192')
text = cv.text
template_vars={'title': title, 'text':text}
template = JINJA_ENVIRONMENT.get_template('home.html')
self.response.out.write(template.render(template_vars))
def post(self):
cv = About.get_or_insert('6684480941064192')
cv.text=self.request.get("texto")
cv.put()
self.redirect('/')
Html(Material design + bootstrp)
<form class="col s12" form action="/" method="POST" id="frmPost" style="margin-top:25px; margin-bottom:10px;">
<div class="row">
<div class="panel panel-heading" style ="border-radius: 0px; background-color: #e57373;">
<h3 class="panel-title" style ="color: white;">About...</h3>
</div>
<textarea rows="10" id="summernote" form="frmPost" name ="texto" style="margin-top:-10px; display:block;">
{{text}}
</textarea>
</div>
</form>
<script>
$(document).ready(function() {
$('#summernote').summernote({
});
});
</script>
【问题讨论】:
标签: python google-app-engine summernote