Мое приложение создало объект с ошибкой, пользователь вставил строку (я считаю), но поле было десятичным.
Я знаю, что формы помешали бы этому, но вставка произошла на декораторе post_save, и теперь я не могу получить доступ к объекту, обновить или удалить его.
comandas_antecipadas = ComandaAntecipado.objects.all()
comandas_antecipadas
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\projetos\barzim\venv\lib\site-packages\django\db\models\query.py", line 244, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
File "C:\projetos\barzim\venv\lib\site-packages\django\db\models\query.py", line 268, in __iter__
self._fetch_all()
File "C:\projetos\barzim\venv\lib\site-packages\django\db\models\query.py", line 1186, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "C:\projetos\barzim\venv\lib\site-packages\django\db\models\query.py", line 63, in __iter__
for row in compiler.results_iter(results):
File "C:\projetos\barzim\venv\lib\site-packages\django\db\models\sql\compiler.py", line 1009, in apply_converters
value = converter(value, expression, connection)
File "C:\projetos\barzim\venv\lib\site-packages\django\db\backends\sqlite3\operations.py", line 254, in converter
return create_decimal(value).quantize(quantize_value, context=expression.output_field.context)
TypeError: argument must be int or float
comandas_antecipadas.count()
11
comandas_antecipadas[9]
<ComandaAntecipado: ComandaAntecipado object (120)>
comandas_antecipadas[10]
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\projetos\barzim\venv\lib\site-packages\django\db\models\query.py", line 302, in __getitem__
qs._fetch_all()
File "C:\projetos\barzim\venv\lib\site-packages\django\db\models\query.py", line 1186, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "C:\projetos\barzim\venv\lib\site-packages\django\db\models\query.py", line 63, in __iter__
for row in compiler.results_iter(results):
File "C:\projetos\barzim\venv\lib\site-packages\django\db\models\sql\compiler.py", line 1009, in apply_converters
value = converter(value, expression, connection)
File "C:\projetos\barzim\venv\lib\site-packages\django\db\backends\sqlite3\operations.py", line 254, in converter
return create_decimal(value).quantize(quantize_value, context=expression.output_field.context)
TypeError: argument must be int or float