def is_field_property(obj):
    """utility function to check if the give object is a field from a protobuf message.

    For now there is not much metadata when inspecting a protobuf
    class compiled by protoc, so the current strategy is:

    1. Take the ``obj.__class__``
    2. Take the ``__name__`` of the class.
    3. Check that the name contains the string "FieldProperty"

    """
    cls = getattr(obj, '__class__', None)
    name = getattr(cls, '__name__', '')
    return name and 'FieldProperty' in name