You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing an error when trying to insert an empty Money value (corresponding to a MoneyField in my model) into a PostgreSQL database. The field value is set as: "price_field": None
Here is the error:
django.db.utils.DataError: value too long for type character varying(3)
So I also tried to set it to an empty money object: "price_field": Money() but then it raises:
The same error occurs when trying to use "price_field": Money(None,None).
Hence my question: how to correctly set a NULL into both the price and price_currency associated field into the database when inserting an empty Money() value?
Many thanks.
The text was updated successfully, but these errors were encountered:
Hello,
I'm facing an error when trying to insert an empty
Money
value (corresponding to aMoneyField
in my model) into a PostgreSQL database. The field value is set as:"price_field": None
Here is the error:
So I also tried to set it to an empty money object:
"price_field": Money()
but then it raises:The same error occurs when trying to use
"price_field": Money(None,None)
.Hence my question: how to correctly set a
NULL
into both theprice
andprice_currency
associated field into the database when inserting an emptyMoney()
value?Many thanks.
The text was updated successfully, but these errors were encountered: