<pre>
field_classes = {
    'deprecation_kind': DeprecationKind,
    'venture': Venture,
}
</pre>
then
<pre>
if name in field_classes:
    setattr(d, name, field_classes[name].objects.get(id=data[name]))
else:
    setattr(d, name, data[name])
</pre>