{"action":"created","issue":{"url":"https://api.github.com/repos/Syncano/syncano-python/issues/239","repository_url":"https://api.github.com/repos/Syncano/syncano-python","labels_url":"https://api.github.com/repos/Syncano/syncano-python/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/Syncano/syncano-python/issues/239/comments","events_url":"https://api.github.com/repos/Syncano/syncano-python/issues/239/events","html_url":"https://github.com/Syncano/syncano-python/issues/239","id":174405137,"number":239,"title":"Bug: User model","user":{"login":"Eggwise","id":20506046,"avatar_url":"https://avatars.githubusercontent.com/u/20506046?v=3","gravatar_id":"","url":"https://api.github.com/users/Eggwise","html_url":"https://github.com/Eggwise","followers_url":"https://api.github.com/users/Eggwise/followers","following_url":"https://api.github.com/users/Eggwise/following{/other_user}","gists_url":"https://api.github.com/users/Eggwise/gists{/gist_id}","starred_url":"https://api.github.com/users/Eggwise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eggwise/subscriptions","organizations_url":"https://api.github.com/users/Eggwise/orgs","repos_url":"https://api.github.com/users/Eggwise/repos","events_url":"https://api.github.com/users/Eggwise/events{/privacy}","received_events_url":"https://api.github.com/users/Eggwise/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"opalczynski","id":15612410,"avatar_url":"https://avatars.githubusercontent.com/u/15612410?v=3","gravatar_id":"","url":"https://api.github.com/users/opalczynski","html_url":"https://github.com/opalczynski","followers_url":"https://api.github.com/users/opalczynski/followers","following_url":"https://api.github.com/users/opalczynski/following{/other_user}","gists_url":"https://api.github.com/users/opalczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/opalczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opalczynski/subscriptions","organizations_url":"https://api.github.com/users/opalczynski/orgs","repos_url":"https://api.github.com/users/opalczynski/repos","events_url":"https://api.github.com/users/opalczynski/events{/privacy}","received_events_url":"https://api.github.com/users/opalczynski/received_events","type":"User","site_admin":false},"assignees":[{"login":"opalczynski","id":15612410,"avatar_url":"https://avatars.githubusercontent.com/u/15612410?v=3","gravatar_id":"","url":"https://api.github.com/users/opalczynski","html_url":"https://github.com/opalczynski","followers_url":"https://api.github.com/users/opalczynski/followers","following_url":"https://api.github.com/users/opalczynski/following{/other_user}","gists_url":"https://api.github.com/users/opalczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/opalczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opalczynski/subscriptions","organizations_url":"https://api.github.com/users/opalczynski/orgs","repos_url":"https://api.github.com/users/opalczynski/repos","events_url":"https://api.github.com/users/opalczynski/events{/privacy}","received_events_url":"https://api.github.com/users/opalczynski/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-08-31T23:45:49Z","updated_at":"2016-09-11T13:38:07Z","closed_at":null,"body":"when trying to list the users in my instance (see following code)\r\n```\r\nsyncano.connect(api_key=API_KEY)\r\nusers = User.please.list(instance_name=INSTANCE)\r\nfor user in users:\r\n    # print(user)\r\n    print(user.user_key)\r\n```\r\n\r\nI get the following error:\r\n\r\n> Traceback (most recent call last):\r\n  File \"***syncano_backend/test/test.py\", line 34, in <module>\r\n    for user in users:\r\n  File \"/usr/local/lib/python3.5/dist-packages/syncano/models/manager.py\", line 812, in iterator\r\n    yield self.serialize(o)\r\n  File \"/usr/local/lib/python3.5/dist-packages/syncano/models/manager.py\", line 741, in serialize\r\n    return model(**properties) if self._serialize else data\r\n  File \"/usr/local/lib/python3.5/dist-packages/syncano/models/archetypes.py\", line 90, in __init__\r\n    self.to_python(kwargs)\r\n  File \"/usr/local/lib/python3.5/dist-packages/syncano/models/archetypes.py\", line 247, in to_python\r\n    setattr(self, field.name, value)\r\n  File \"/usr/local/lib/python3.5/dist-packages/syncano/models/fields.py\", line 105, in __set__\r\n    instance._raw_data[self.name] = self.to_python(value)\r\n  File \"/usr/local/lib/python3.5/dist-packages/syncano/models/fields.py\", line 524, in to_python\r\n    return self.rel(**value)\r\n  File \"/usr/local/lib/python3.5/dist-packages/syncano/models/classes.py\", line 145, in __new__\r\n    raise SyncanoValidationError('Field \"instance_name\" is required.')\r\nsyncano.exceptions.SyncanoValidationError: Field \"instance_name\" is required.\r\n\r\nI tested my api key in http://docs.syncano.io/v0.1.1/docs/users-list and it worked. It looks like the python lib cant create a user model object from the response.\r\n\r\n\r\n\r\nCode from the stacktrace\r\n```\r\n\r\n   def serialize(self, data, model=None):\r\n        \"\"\"Serializes passed data to related :class:`~syncano.models.base.Model` class.\"\"\"\r\n        model = model or self.model\r\n        if data == '':\r\n            return\r\n\r\n        if isinstance(data, model):\r\n            return data\r\n\r\n        if not isinstance(data, dict):\r\n            raise SyncanoValueError('Unsupported data type.')\r\n\r\n        properties = deepcopy(self.properties)\r\n        properties.update(data)\r\n        return model(**properties) if self._serialize else data`\r\n\r\n\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Syncano/syncano-python/issues/comments/246180716","html_url":"https://github.com/Syncano/syncano-python/issues/239#issuecomment-246180716","issue_url":"https://api.github.com/repos/Syncano/syncano-python/issues/239","id":246180716,"user":{"login":"Eggwise","id":20506046,"avatar_url":"https://avatars.githubusercontent.com/u/20506046?v=3","gravatar_id":"","url":"https://api.github.com/users/Eggwise","html_url":"https://github.com/Eggwise","followers_url":"https://api.github.com/users/Eggwise/followers","following_url":"https://api.github.com/users/Eggwise/following{/other_user}","gists_url":"https://api.github.com/users/Eggwise/gists{/gist_id}","starred_url":"https://api.github.com/users/Eggwise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eggwise/subscriptions","organizations_url":"https://api.github.com/users/Eggwise/orgs","repos_url":"https://api.github.com/users/Eggwise/repos","events_url":"https://api.github.com/users/Eggwise/events{/privacy}","received_events_url":"https://api.github.com/users/Eggwise/received_events","type":"User","site_admin":false},"created_at":"2016-09-11T13:38:07Z","updated_at":"2016-09-11T13:38:07Z","body":"Hi, \r\nOk, maybe i can fix the bug in my spare time.\r\nthanks for the response.\r\nCheers"}}
{"actor":{"display_login":"Eggwise"}}