{"action":"opened","issue":{"url":"https://api.github.com/repos/beregond/jsonmodels/issues/60","labels_url":"https://api.github.com/repos/beregond/jsonmodels/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/beregond/jsonmodels/issues/60/comments","events_url":"https://api.github.com/repos/beregond/jsonmodels/issues/60/events","html_url":"https://github.com/beregond/jsonmodels/issues/60","id":112625238,"number":60,"title":"Exception while creating models with ListFields","user":{"login":"hdantas","id":1424659,"avatar_url":"https://avatars.githubusercontent.com/u/1424659?v=3","gravatar_id":"","url":"https://api.github.com/users/hdantas","html_url":"https://github.com/hdantas","followers_url":"https://api.github.com/users/hdantas/followers","following_url":"https://api.github.com/users/hdantas/following{/other_user}","gists_url":"https://api.github.com/users/hdantas/gists{/gist_id}","starred_url":"https://api.github.com/users/hdantas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdantas/subscriptions","organizations_url":"https://api.github.com/users/hdantas/orgs","repos_url":"https://api.github.com/users/hdantas/repos","events_url":"https://api.github.com/users/hdantas/events{/privacy}","received_events_url":"https://api.github.com/users/hdantas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-21T16:11:08Z","updated_at":"2015-10-21T16:11:08Z","closed_at":null,"body":"I'm unable to instantiate models with ListFields that accept more than one type.\r\nFor the example below I get the following exception:\r\n```python\r\njsonmodels.errors.ValidationError: Cannot decide which type to choose from \"Cat, Dog\".\r\n```\r\n\r\nI'm running the version 2.0.1 of jsonmodels, on Python 2.7.10, OS X 10.11\r\nIf I comment line 218 on `fields.py` everything appears to work correctly, basically removing the call to `self._check_items_types_count()`. I might be missing something but don't really understand why you're checking if the `len` of `items_types` is one.\r\n\r\nHere is the complete code to reproduce the issue described:\r\n```python\r\nfrom jsonmodels import models, fields, errors, validators\r\n\r\nclass Cat(models.Base):\r\n    name = fields.StringField(required=True)\r\n    breed = fields.StringField()\r\n\r\nclass Dog(models.Base):\r\n    name = fields.StringField(required=True)\r\n    age = fields.IntField()\r\n\r\nclass Car(models.Base):\r\n    registration_number = fields.StringField(required=True)\r\n    engine_capacity = fields.FloatField()\r\n    color = fields.StringField()\r\n\r\nclass Person(models.Base):\r\n    name = fields.StringField(required=True)\r\n    surname = fields.StringField(required=True)\r\n    car = fields.EmbeddedField(Car)\r\n    pets = fields.ListField(items_types=[Cat, Dog])\r\n\r\ncat = Cat(name='Garfield')\r\ndog = Dog(name='Dogmeat', age=9)\r\ncar = Car(registration_number='ASDF 777', color='red')\r\n\r\nperson = Person(name='Johny', surname='Bravo', car=car, pets=[cat, dog])\r\nprint person.to_struct()\r\n```"}}