Skip to content

Commit

Permalink
Merge 5ea83b2 into 9e77326
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed Jul 4, 2018
2 parents 9e77326 + 5ea83b2 commit 0fda74b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mixer/factory.py
Expand Up @@ -129,6 +129,10 @@ class GenFactory(_.with_metaclass(GenFactoryMeta)):
_.integer_types: int,
}

name_hooks = {
'UUID': t.UUID,
}

@classmethod
def cls_to_simple(cls, fcls):
""" Translate class to one of simple base types.
Expand All @@ -147,6 +151,10 @@ def cls_to_simple(cls, fcls):
if issubclass(fcls, stype):
return cls.types[stype]

for name, generator in cls.name_hooks.items():
if name in fcls.__name__:
return generator

return None

@staticmethod
Expand Down

0 comments on commit 0fda74b

Please sign in to comment.