开发者

How to save StringListProperty from input type text - Appengine Python

开发者 https://www.devze.com 2023-04-12 14:28 出处:网络
开发者_如何转开发I need to save the value of an input type text into a StringListProperty property in Google Appengine with Python.
开发者_如何转开发

I need to save the value of an input type text into a StringListProperty property in Google Appengine with Python.

If I try:

author.books = self.request.get('books')
author.put()

Then I get a 'Property books must be a list' error.

I need it to work with the following text in the input (2 or 1 books separated by commas):

  • The Da Vinci Code, Angels & Demons
  • Fahrenheit 451

Thanks for your help!


author.books = self.request.get('books').split(', ')

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号