How to save StringListProperty from input type text - Appengine 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(', ')
精彩评论