Motivation for this PR:
I needed to be able to provide custom to_python, get_prep_value methods on the generated field class. Currently this is not possible as CompositeTypeMeta.__new__ will only use BaseField as a base to generating a field class.
Changes in this PR:
When a class named Field is supplied on a subclass of CompositeType we respect this and use it as a base class instead of the placeholder (CompositeType.Field) class.
Motivation for this PR: I needed to be able to provide custom
to_python
,get_prep_value
methods on the generated field class. Currently this is not possible asCompositeTypeMeta.__new__
will only useBaseField
as a base to generating a field class.Changes in this PR: When a class named
Field
is supplied on a subclass ofCompositeType
we respect this and use it as a base class instead of the placeholder (CompositeType.Field
) class.