Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: naive datetime #220

Open
spch-GL opened this issue Nov 18, 2021 · 0 comments · May be fixed by #320
Open

WARNING: naive datetime #220

spch-GL opened this issue Nov 18, 2021 · 0 comments · May be fixed by #320

Comments

@spch-GL
Copy link
Contributor

spch-GL commented Nov 18, 2021

Lors de la génération des graphiques ou du rapport, il y a maintenant ces warnings qui apparaissent et je trouve cela bizarre car je pense qu'on écrit pas dans la base à ce moment...
exemple:

2021-11-18T09:39:59     WARNING    warning:C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\fields\__init__.py:1358: RuntimeWarning:
             
             DateTimeField CountDetail.timestamp received a naive datetime (2020-06-22 00:00:00) while time zone support is active.
             
             
             traceback: File "", line 2, in 
              File "C:\Users/GrelletP/AppData/Roaming/QGIS/QGIS3\profiles\cptg_dev/python/plugins\comptages\comptages.py", line 544, in do_generate_chart_action
              self.chart_dock.set_attributes(count)
              File "C:\Users/GrelletP/AppData/Roaming/QGIS/QGIS3\profiles\cptg_dev/python/plugins\comptages\chart\chart_dialog.py", line 59, in set_attributes
              self._populate_tab(tab, section, count, approval_process)
              File "C:\Users/GrelletP/AppData/Roaming/QGIS/QGIS3\profiles\cptg_dev/python/plugins\comptages\chart\chart_dialog.py", line 109, in _populate_tab
              ChartTime(
              File "C:\Users/GrelletP/AppData/Roaming/QGIS/QGIS3\profiles\cptg_dev/python/plugins\comptages\chart\chart_dialog.py", line 317, in get_div
              df = statistics.get_time_data(
              File "C:\Users/GrelletP/AppData/Roaming/QGIS/QGIS3\profiles\cptg_dev/python/plugins\comptages\core\statistics.py", line 22, in get_time_data
              qs = models.CountDetail.objects.filter(
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
              return getattr(self.get_queryset(), name)(*args, **kwargs)
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\query.py", line 941, in filter
              return self._filter_or_exclude(False, args, kwargs)
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\query.py", line 961, in _filter_or_exclude
              clone._filter_or_exclude_inplace(negate, args, kwargs)
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\query.py", line 968, in _filter_or_exclude_inplace
              self._query.add_q(Q(*args, **kwargs))
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\sql\query.py", line 1393, in add_q
              clause, _ = self._add_q(q_object, self.used_aliases)
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\sql\query.py", line 1412, in _add_q
              child_clause, needed_inner = self.build_filter(
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\sql\query.py", line 1347, in build_filter
              condition = self.build_lookup(lookups, col, value)
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\sql\query.py", line 1193, in build_lookup
              lookup = lookup_class(lhs, rhs)
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\lookups.py", line 25, in __init__
              self.rhs = self.get_prep_lookup()
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\lookups.py", line 240, in get_prep_lookup
              rhs_value = self.lhs.output_field.get_prep_value(rhs_value)
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\fields\__init__.py", line 1406, in get_prep_value
              value = super().get_prep_value(value)
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\fields\__init__.py", line 1266, in get_prep_value
              return self.to_python(value)
              File "C:\apps\OSGeo4W\apps\Python39\lib\site-packages\django\db\models\fields\__init__.py", line 1358, in to_python
              warnings.warn("DateTimeField %s.%s received a naive datetime "

@why-not-try-calmer why-not-try-calmer linked a pull request Dec 21, 2023 that will close this issue
@why-not-try-calmer why-not-try-calmer added this to the Finish p3 milestone Jan 9, 2024
@why-not-try-calmer why-not-try-calmer linked a pull request Jan 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants