Saturday, May 29, 2021

Please need a solution urgently for django.db.utils.DatabaseError



[30/May/2021 11:01:46] "POST /api/addtocart/ HTTP/1.1" 500 214965
Internal Server Error: /api/addtocart/
Traceback (most recent call last):
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\query.py", line 856, in parse
    return handler(self, statement)
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\query.py", line 932, in _select
    return SelectQuery(self.db, self.connection_properties, sm, self._params)
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\query.py", line 116, in __init__
    super().__init__(*args)
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\query.py", line 62, in __init__
    self.parse()
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\query.py", line 152, in parse
    self.where = WhereConverter(self, statement)
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\converters.py", line 27, in __init__
    self.parse()
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\converters.py", line 119, in parse
    self.op = WhereOp(
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\operators.py", line 476, in __init__
    self.evaluate()
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\operators.py", line 465, in evaluate
    op.evaluate()
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\operators.py", line 465, in evaluate
    op.evaluate()
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\operators.py", line 258, in evaluate
    self.rhs.negate()
AttributeError: 'NoneType' object has no attribute 'negate'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\cursor.py", line 51, in execute
    self.result = Query(
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\query.py", line 783, in __init__
    self._query = self.parse()
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\sql2mongo\query.py", line 884, in parse
    raise exe from e
djongo.exceptions.SQLDecodeError:

        Keyword: None
        Sub SQL: None
        FAILED SQL: SELECT "shop_cart"."id", "shop_cart"."customer_id", "shop_cart"."total", "shop_cart"."complit", "shop_cart"."date" FROM "shop_cart" WHERE ("shop_cart"."customer_id" = %(0)s AND NOT "shop_cart"."complit") ORDER BY "shop_cart"."id" ASC LIMIT 1
        Params: (13,)
        Version: 1.3.4

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\cursor.py", line 59, in execute
    raise db_exe from e
djongo.database.DatabaseError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\views\generic\base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "D:\Bhathiya Admin\Python\lib\site-packages\rest_framework\views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "D:\Bhathiya Admin\Python\lib\site-packages\rest_framework\views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "D:\Bhathiya Admin\Python\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception
    raise exc
  File "D:\Bhathiya Admin\Python\lib\site-packages\rest_framework\views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "D:\Final Version\shop\views.py", line 248, in post
    cart_cart = Cart.objects.filter(
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\models\query.py", line 674, in first
    for obj in (self if self.ordered else self.order_by('pk'))[:1]:
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\models\query.py", line 280, in __iter__
    self._fetch_all()
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\models\query.py", line 1324, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\models\query.py", line 51, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\models\sql\compiler.py", line 1175, in execute_sql
    cursor.execute(sql, params)
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\backends\utils.py", line 98, in execute
    return super().execute(sql, params)
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\backends\utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\backends\utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\cursor.py", line 59, in execute
    raise db_exe from e
django.db.utils.DatabaseError

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5f3cc5a4-0dac-4f3c-9493-be0fe32d74c9n%40googlegroups.com.

No comments:

Post a Comment