Skip to content

Multiple aggregates and TZ error fixed - #2

Open
mpcabd wants to merge 2 commits into
bashu:masterfrom
mpcabd:master
Open

Multiple aggregates and TZ error fixed#2
mpcabd wants to merge 2 commits into
bashu:masterfrom
mpcabd:master

Conversation

@mpcabd

@mpcabd mpcabd commented Jun 26, 2013

Copy link
Copy Markdown
  • Added multiple aggregates in one query.
  • Fixed TZ error.

@kmike

kmike commented Jun 29, 2013

Copy link
Copy Markdown
Collaborator

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!

@mpcabd

mpcabd commented Jun 29, 2013

Copy link
Copy Markdown
Author

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.

@PetrDlouhy

Copy link
Copy Markdown
Collaborator

@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 setup.py.

@bashu

bashu commented Aug 28, 2026

Copy link
Copy Markdown
Owner

to @PetrDlouhy do you still want (or have time) to maintain this project?

@PetrDlouhy

PetrDlouhy commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

@bashu I don't use this package anymore.
I can still maintain in sense that I would merge PRs and release new versions, especially if somebody would do the housekeeping first (update the testing matrix etc.).

But if you want to take over the maintanence, I can give you the rights.

@bashu

bashu commented Aug 29, 2026

Copy link
Copy Markdown
Owner

@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

@PetrDlouhy

Copy link
Copy Markdown
Collaborator

@bashu I sent you invite to GH q PyPI. I tried to transwer ownership, but it failed, because "bashu/django-qsstats-magic already exists".

@bashu

bashu commented Aug 31, 2026

Copy link
Copy Markdown
Owner

@PetrDlouhy can you try again? I removed my own fork

@PetrDlouhy

Copy link
Copy Markdown
Collaborator

@bashu Do you now have everything?

@bashu

bashu commented Aug 31, 2026

Copy link
Copy Markdown
Owner

@PetrDlouhy yes! and I already work on next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants