Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
'name': XSD_NEGATIVE_INTEGER,
'python_type': (long_type, int),
'base_type': XSD_NON_POSITIVE_INTEGER,
'facets': [negative_int_validator, etree_element(XSD_MAX_INCLUSIVE, value='-1')]
}, # only negative value allowed [< 0]
)
XSD_10_BUILTIN_TYPES = XSD_COMMON_BUILTIN_TYPES + (
# --- Year related primitive types (year 0 not allowed) ---
{
'name': XSD_DATETIME,
'python_type': (unicode_type, str, datatypes.DateTime10),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],
'to_python': datatypes.DateTime10.fromstring,
}, # [-][Y*]YYYY-MM-DD[Thh:mm:ss]
{
'name': XSD_DATE,
'python_type': (unicode_type, str, datatypes.Date10),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],
'to_python': datatypes.Date10.fromstring,
}, # [-][Y*]YYYY-MM-DD
{
'name': XSD_GYEAR,
'python_type': (unicode_type, str, datatypes.GregorianYear10),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],
'to_python': datatypes.GregorianYear10.fromstring,
}, # [-][Y*]YYYY
{
'base_type': XSD_INTEGER,
'facets': [non_positive_int_validator, etree_element(XSD_MAX_INCLUSIVE, value='0')]
}, # only zero and smaller value allowed [<= 0]
{
'name': XSD_NEGATIVE_INTEGER,
'python_type': (long_type, int),
'base_type': XSD_NON_POSITIVE_INTEGER,
'facets': [negative_int_validator, etree_element(XSD_MAX_INCLUSIVE, value='-1')]
}, # only negative value allowed [< 0]
)
XSD_10_BUILTIN_TYPES = XSD_COMMON_BUILTIN_TYPES + (
# --- Year related primitive types (year 0 not allowed) ---
{
'name': XSD_DATETIME,
'python_type': (unicode_type, str, datatypes.DateTime10),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],
'to_python': datatypes.DateTime10.fromstring,
}, # [-][Y*]YYYY-MM-DD[Thh:mm:ss]
{
'name': XSD_DATE,
'python_type': (unicode_type, str, datatypes.Date10),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],
'to_python': datatypes.Date10.fromstring,
}, # [-][Y*]YYYY-MM-DD
{
'name': XSD_GYEAR,
'python_type': (unicode_type, str, datatypes.GregorianYear10),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],