Value type

Add full support for value-types.

Scrutinizer will probably complain a bit about methods complexity, I'll (hopefully) fix that tomorrow.
because pony

On 11/11/2014 17:36, Thomas Tanon wrote:
>> +
>> +    def as_dict(self):
>> +        d = self._attributes.copy()
>> +        type_ = d.get('value_type', 'string')
>> +        value = d.get('value')
>> +        d['value'] = self._format_value(value)
>> +        if type_ != 'string':
>> +            d['value-type'] = type_
>> +        if 'value_type' in d:
>> +            del d['value_type']
>> +        return d
>> +
>> +@register_valuetype
>> +class StringResource(Resource):
>> +    _value_type = 'string'
>> +    _possible_attributes = Resource._possible_attributes + ('language',)
> 
> Why _possible_attributes overriding here and not for TimeResource?
> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/ProjetPP/PPP-datamodel-Python/pull/11/files#r20161555
>