Commit 1b57c4d6 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Added more datetime formats. Fixed definitions for categories of categories.

parent d945e002
Pipeline #89129 passed with stages
in 40 minutes and 32 seconds
......@@ -407,7 +407,17 @@ class _Datetime(DataType):
except ValueError:
pass
raise TypeError('Invalid date literal "{0}"'.format(datetime_str))
try:
return datetime.strptime(datetime_str, '%Y-%m-%d %H:%M:%S.%f')
except ValueError:
pass
try:
return datetime.strptime(datetime_str, '%Y-%m-%d %H:%M:%S')
except ValueError:
pass
raise TypeError('Invalid date literal %s' % datetime_str)
def _convert(self, value):
if value is None:
......@@ -2597,10 +2607,14 @@ class Category(Definition):
definitions = set()
for definition in self.definitions:
if isinstance(definition, MCategory):
definition = definition.m_def
if isinstance(definition, Category):
definition.get_all_definitions(definitions)
if definition not in definitions:
definitions.add(definition)
if isinstance(definition, Category):
definition.get_all_definitions(definitions)
return definitions
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment