Django Queryset

61 views
Skip to first unread message

lada...@gmail.com

unread,
Nov 4, 2020, 6:29:58 AM11/4/20
to Django users
Hello, Django Users please I need your help and it is urgent,

          I have this code:
permit_cy = Permit.objects.values(
        'info__date_of_transaction__year', 'info__country_destination__continent'
    ).annotate(volume=Sum('volume')
    ).order_by('info__country_destination__continent'
    ).filter(info__date_of_transaction__range=["2019-01-01", "2020-12-31"])

and this Queryset:

<QuerySet [{'info__date_of_transaction__year': 2019, 'info__country_destination__continent': 'Africa', 'volume': Decimal('214.330')}, {'info__date_of_transaction__year': 2020, 'info__country_destination__continent': 'Africa', 'volume': Decimal('1546.482')}, {'info__date_of_transaction__year': 2020, 'info__country_destination__continent': 'Asia/Far East', 'volume': Decimal('5678.234')}, {'info__date_of_transaction__year': 2020, 'info__country_destination__continent': 'EU', 'volume': Decimal('100.282')}]> 2019 2020 2020 2020

Please how do use it in the template to get something like this, 
Capture.PNG

Walter Randazzo

unread,
Nov 4, 2020, 7:35:05 PM11/4/20
to django...@googlegroups.com
Hi there. 

Did you try datatable

Regards,

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2a7e56f3-e4d1-4cbe-87c6-1e9675aa0ab3n%40googlegroups.com.

MAMADOU KANTE

unread,
Dec 13, 2020, 10:22:27 PM12/13/20
to django...@googlegroups.com
Hi to everybody;
I have been trying to deploy an app through heroku for the past 7 days but whenever I reach the final stage  I receive a rejection message.
The message tells me the module "skbuild" was not imported or I should upgrade my pip version. But when I check through the terminal
I find that I can import skbuild and the latest version of pip is installed on the machine.
I tried to deploy by linking my Github repository to heroku but I still receive the same error message as described below:
Python app detected
 !     Python has released a security update! Please consider upgrading to python-3.9.1
       Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.9.0
-----> Installing pip 9.0.2, setuptools 47.1.1 and wheel 0.34.2
-----> Installing dependencies with Pipenv 2018.5.18…
       Installing dependencies from Pipfile.lock (db603f)…
       An error occurred while installing opencv-python==4.4.0.46! Will try again.
       Installing initially–failed dependencies…
           Traceback (most recent call last):
             File "<string>", line 1, in <module>
             File "/tmp/pip-build-m9tvr4w5/opencv-python/setup.py", line 9, in <module>
               import skbuild
           ModuleNotFoundError: No module named 'skbuild'
       Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-m9tvr4w5/opencv-python/
       You are using pip version 9.0.2, however version 20.3.1 is available.
       You should consider upgrading via the 'pip install --upgrade pip' command.
       
 !     Push rejected, failed to compile Python app.
 !     Push failed
CAN ANYONE HELP?


Jorge Gimeno

unread,
Dec 13, 2020, 11:01:48 PM12/13/20
to django...@googlegroups.com
I would start by upgrading pip (https://pypi.org/project/pip/).  Version 9.x was quite some time ago.  Also, pipenv's current version is 2020.11.15 (https://pypi.org/project/pipenv/).

-Jorge
 
Reply all
Reply to author
Forward
0 new messages