Instead of a single StringProperty(), I want to store a list of strings
class BlogPost(ndb.Model):
s1 = ndb.StringProperty(required=True)
s2 = ndb.StringProperty(required=True)
s3 = ndb.StringProperty(required=True)
I would rather go
class BlogPost(ndb.Model):
my_strings = ndb.StringListProperty() # does this exist?
yes, use a repeated property:
Any property with repeated=True becomes a repeated property. The property takes a list of values of the underlying type, rather than a single value. For example, the value of a property defined with IntegerProperty(repeated=True) is a list of integers.
see the docs: Repeated Properties
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With