Coalesce() worked in postgres as well. Thank you.
On Jun 30, 10:34 pm, J wrote:
> Thank you Tim, that worked perfectly in sqlite, and I imagine it will
> work well inpostgresas well. My server is down right now, so I can't
> say for sure, but I will definitely try this out.
Thank you Tim, that worked perfectly in sqlite, and I imagine it will
work well in postgres as well. My server is down right now, so I can't
say for sure, but I will definitely try this out.
Thanks again,
J
On Jun 30, 3:10 pm, Tim Chase wrote:
> > Here's my
> Here's my query, (I'm using the stable release version of django,
> otherwise I'd use "annotate" which I found is present in the
> development version).
>
> contest = Participant.objects.extra(select={
>'contest_stats': """
> SELECT SUM(amt)
> FROM
That's a good point. Thanks Jeff.
The reason they are none, or have a null value, is because there are
actually no related records in the related table.
Two Tables:
Participants (contains all potential participants)
Data (contains actual participant activity)
If there is a way to convert those
Any reason not to make the total 0 instead of None? Null in database
(or None in Python) has a special meaning, and it doesn't always make
sense to sort a list of (mostly) integers with some null values.
-Jeff
On Jun 30, 2:01 am, J wrote:
> Hello,
>
> I developed an app
Hello,
I developed an app for an online contest.
In this app, I requested a queryset with totals from a related table,
and wanted to display the top ten participants. So, I sorted the
queryset on the totals field, descending. Some participants didn't have
any items, so the total for these was
6 matches
Mail list logo