<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def allow_upcast(self, to):
 """ Return true if the field type may be upcast to the other field type `to`. This relation specifies when it is safe to transfer data from this field type to the given other field type `to`. This is the case if any of the following holds true: * `to` is equal to this type * this type is :attr:`TEXT_SINGLE` and `to` is :attr:`TEXT_PRIVATE` """


        if self == to:
            return True
        if self == FieldType.TEXT_SINGLE and to == FieldType.TEXT_PRIVATE:
            return True
        return False