Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Repeated StringProperty only stores the first assigned value instead of all of them #27

Open

Description

@MihailRussu

When assigning more than one value to a repeated StringProperty - only the first one gets stored, i.e.:

from wtforms_appengine.ndb import model_form
from google.appengine.ext import ndb
from webob.multidict import MultiDict

class Model(ndb.Model):
   s = ndb.StringProperty(repeated=True)

ModelForm = model_form(Model)

md = MultiDict()
md.add(key='s', value='x')
md.add(key='s', value='y')

print md # CORRECTLY prints TWO values for the "s" key, i.e. `MultiDict([('s', 'x'), ('s', 'y')])`

mf = ModelForm(md)

print mf.s.data # INCORRECTLY prints only the first value for the "s" key, i.e. `['x']`

Shouldn't the last line in the example above print ['x', 'y'] instead of just ['x']?

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions