Created
September 5, 2020 17:54
-
-
Save eversoncoutinho/803e819c3afcd511b2250b084c96e3bc to your computer and use it in GitHub Desktop.
Erro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OperationalError at /admin/core/movmensalista/ | |
no such column: core_movmensalista.data_pagamento | |
Request Method: GET | |
Request URL: http://127.0.0.1:8000/admin/core/movmensalista/ | |
Django Version: 3.1.1 | |
Exception Type: OperationalError | |
Exception Value: | |
no such column: core_movmensalista.data_pagamento | |
Exception Location: /home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py, line 413, in execute | |
Python Executable: /home/everson/Documentos/Projetos/Estacionamento_projeto/venv/bin/python | |
Python Version: 3.7.5 | |
Python Path: | |
['/home/everson/Documentos/Projetos/Estacionamento_projeto', | |
'/usr/lib/python37.zip', | |
'/usr/lib/python3.7', | |
'/usr/lib/python3.7/lib-dynload', | |
'/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages'] | |
Server time: Sat, 05 Sep 2020 14:06:08 -0300 | |
Traceback Switch to copy-and-paste view | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/backends/utils.py, line 84, in _execute | |
return self.cursor.execute(sql, params) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py, line 413, in execute | |
This fixes it -- but note that if you want to use a literal "%s" in a query, | |
you'll need to use "%%s". | |
""" | |
def execute(self, query, params=None): | |
if params is None: | |
return Database.Cursor.execute(self, query) | |
query = self.convert_query(query) | |
return Database.Cursor.execute(self, query, params) … | |
def executemany(self, query, param_list): | |
query = self.convert_query(query) | |
return Database.Cursor.executemany(self, query, param_list) | |
def convert_query(self, query): | |
▶ Local vars | |
Variable Value | |
params | |
() | |
query | |
('SELECT "core_movmensalista"."id", "core_movmensalista"."mensalista_id", ' | |
'"core_movmensalista"."data_pagamento", "core_movmensalista"."total" FROM ' | |
'"core_movmensalista" ORDER BY "core_movmensalista"."id" DESC') | |
self | |
<django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x7f0d49531910> | |
The above exception (no such column: core_movmensalista.data_pagamento) was the direct cause of the following exception: | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/core/handlers/exception.py, line 47, in inner | |
response = get_response(request) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/core/handlers/base.py, line 179, in _get_response | |
response = wrapped_callback(request, *callback_args, **callback_kwargs) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/contrib/admin/options.py, line 614, in wrapper | |
return self.admin_site.admin_view(view)(*args, **kwargs) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/utils/decorators.py, line 130, in _wrapped_view | |
response = view_func(request, *args, **kwargs) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/views/decorators/cache.py, line 44, in _wrapped_view_func | |
response = view_func(request, *args, **kwargs) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/contrib/admin/sites.py, line 233, in inner | |
return view(request, *args, **kwargs) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/utils/decorators.py, line 43, in _wrapper | |
return bound_method(*args, **kwargs) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/utils/decorators.py, line 130, in _wrapped_view | |
response = view_func(request, *args, **kwargs) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/contrib/admin/options.py, line 1811, in changelist_view | |
'selection_note': _('0 of %(cnt)s selected') % {'cnt': len(cl.result_list)}, … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/models/query.py, line 269, in __len__ | |
self._fetch_all() … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/models/query.py, line 1303, in _fetch_all | |
self._result_cache = list(self._iterable_class(self)) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/models/query.py, line 53, in __iter__ | |
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py, line 1156, in execute_sql | |
cursor.execute(sql, params) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/backends/utils.py, line 98, in execute | |
return super().execute(sql, params) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/backends/utils.py, line 66, in execute | |
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/backends/utils.py, line 75, in _execute_with_wrappers | |
return executor(sql, params, many, context) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/backends/utils.py, line 84, in _execute | |
return self.cursor.execute(sql, params) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/utils.py, line 90, in __exit__ | |
raise dj_exc_value.with_traceback(traceback) from exc_value … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/backends/utils.py, line 84, in _execute | |
return self.cursor.execute(sql, params) … | |
▶ Local vars | |
/home/everson/Documentos/Projetos/Estacionamento_projeto/venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py, line 413, in execute | |
return Database.Cursor.execute(self, query, params) … | |
▼ Local vars |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment