Multiple aggregates and TZ error fixed - #2
Conversation
mpcabd
commented
Jun 26, 2013
- Added multiple aggregates in one query.
- Fixed TZ error.
|
Hi @mpcabd, I think that your changes are a good idea performance-wise, but IMHO the API becomes significally worse for simple cases. What do you think about returning lists only when a list of aggregates are passed (this is usually a bad idea though), or to provide an another class (e.g. MultiQuerySetStats) that returns lists and accepts lists? About TZ changes: there is a ticket for it ( https://bitbucket.org/kmike/django-qsstats-magic/issue/6/zero-data-with-django-14-use_tz-true ), but I wasn't able to reproduce it while ago. Could you please provide a test case that demonstrates the issue? Thanks! |
|
Hi @kmike, In this commit @3bc1d66 I made the class return the results in the same tuple, so instead of always returning a list the class now returns the data within the same tuple. But I agree that may be a MultiQuerySetStats class would be a better solution. I will do it that way and push it to my fork. As for the TZ issue, you need to try and create a Django application where USE_TZ = True and any time zone that's not UTC for example in my case TIME_ZONE = 'Asia/Dubai' which is UTC+4, then all your queries will return 0 values because of the TZ difference between the code and the DB since Django saves the data in the DB in UTC timezone while python will be using UTC+4. Thanks. |
|
@mpcabd Could you please update this? Rebase to the master (which should trigger Travis tests), apply the MultiQuerySetStats solution and make automated test for the TZ error fix? I would also prefer, if this is split into two separate PRs (as I understand, these are two separate problems). Please, don't change the repository URL in |
|
to @PetrDlouhy do you still want (or have time) to maintain this project? |
|
@bashu I don't use this package anymore. But if you want to take over the maintanence, I can give you the rights. |
|
@PetrDlouhy Thank you, I'd like to take over maintenance. I'll start with the housekeeping: updating the testing matrix, CI config, and getting the test suite green before working through open PRs and issues like this one. Could you transfer the repository to my account (https://github.com/bashu) and add me as a maintainer/owner on PyPI for django-qsstats-magic so I can cut releases? PS. I still use this app/library in production, so it's important for my work |
|
@bashu I sent you invite to GH q PyPI. I tried to transwer ownership, but it failed, because "bashu/django-qsstats-magic already exists". |
|
@PetrDlouhy can you try again? I removed my own fork |
|
@bashu Do you now have everything? |
|
@PetrDlouhy yes! and I already work on next release |