From be0b8968651f98b962a18c4e750d6396c0fdaf47 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 15 Jan 2017 19:35:30 +0100 Subject: add functions to fancify items --- gamelocker/janus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gamelocker/janus.py') diff --git a/gamelocker/janus.py b/gamelocker/janus.py index c4fd384..99c0a57 100644 --- a/gamelocker/janus.py +++ b/gamelocker/janus.py @@ -267,7 +267,7 @@ class Attribute(object): #Attribute Class to map Data from input Object to Messa transformation to json. """ - __primitive_types = (str,str,int,int,float,bool) #all allowed types for attribute values. (lists and dicts are also allowed, but treated differently) + __primitive_types = (str,int,float,bool) #all allowed types for attribute values. (lists and dicts are also allowed, but treated differently) value = None #holds the actual value of this attribute once it is set. @@ -289,7 +289,7 @@ class Attribute(object): #Attribute Class to map Data from input Object to Messa sets all needed configurations and checks if value is a primitive type or list or dict. """ - if value_type in self.__primitive_types or value_type == list or value_type == dict or issubclass(value_type,DataMessage): + if issubclass(value_type, self.__primitive_types + (list, dict)) or issubclass(value_type,DataMessage): self.value_type = value_type self.name = name self.required = required -- cgit v1.3.1