code: def get_object(self, ObjectClass, id):
          
          try:
              object = ObjectClass.objects.get(id=id)
          except (ObjectClass.DoesNotExist, ObjectClass.MultipleObjectsReturned):
              object = None
          return object
docs: Retrieve object of type ``ObjectClass`` by ``id``.
  
          | Returns object on success.
          | Returns None otherwise.