def get_object_from_ids(ct_id, id):
    try:
        ct = ContentType.objects.get_for_id(ct_id)
    except ContentType.DoesNotExist:
        raise Http404()
    try:
        return ct.get_object_for_this_type(pk=id)
    except ct.model_class().DoesNotExist:
        raise Http404()
Dynamic trait change handler.
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient/common/permissions/utils.py/get_object_from_ids--crossover with--dataset/ETHPy150Open enthought/pyface/pyface/workbench/workbench.py/Workbench._on_window_opening