On Fri, Apr 22, 2016 at 04:53:35PM +0100, Andrii Iudin wrote: > Dear Dave and generateDS mailing group, > > After updating to the recent version 2.22a the generated Python source > code for structures appears to have a validation of xs:date elements. > We have one with a facet minInclusive set to '2002-01-01'. The > previously used version 2.13a produced just > def validate_dateType(self, value): > # Validate type dateType, a restriction on xs:date. > pass > > However, now it is defined as > def validate_dateType(self, value): > # Validate type dateType, a restriction on xs:date. > if value is not None and Validate_simpletypes_: > if value < 2002-01-01: > warnings_.warn('Value "%(value)s" does not match xsd > minInclusive restriction on dateType' % {"value" : value} ) > > This comparison results in "TypeError: can't compare datetime.date to int".
Andrii, Definitely looks and smells like a bug. At the very least, that date in the comparison should have quotes around it. What if, for the date and time types, we generated the following instead? if value < "2002-01-01": warnings_.warn('Value "%(value)s" does not match xsd Would that be what you want? We'd also have to cover the cases for maxInclusive, minExclusive, and maxExclusive. I'll look into it. Thanks for reporting this. Dave > > Please could you tell if there is a fix available for this or a > parameter that can be adjusted when generating the code? > > Thank you and best regards, Andrii > -- Dave Kuhlman http://www.davekuhlman.org ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users