Fix raising exception when trying to prepare_value at field using a list of no-str elements.

Value for DB is now casting to the value needed, to avoid postgresql requiring a explicit cast