Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
SELECT date_trunc('minutes', used_on) as ts, count(*) FROM lippukala_order o, lippukala_code c
WHERE o.id=c.id AND c.used_on between '2015-09-05 00:07:00'::timestamp AND '2015-09-05 14:00:00'::timestamp 
GROUP BY ts ORDER BY ts;

Minkä kokoisia tilauksia ihmiset tilaa

Code Block
languagepy
titlepython manage.py shell
In [6]: ops = OrderProduct.objects.filter(
   ...:     order__event__slug='tracon2017',
   ...:     order__confirm_time__isnull=False,
   ...:     order__payment_date__isnull=False,
   ...:     order__cancellation_time__isnull=True,
   ...:     count__gte=1,
   ...:     product__name__icontains='viikonloppu',
   ...: )
In [7]: ops.count()
Out[7]: 2170
In [8]: c = Counter()
In [9]: for op in ops:
   ...:     c[op.count] += 1
   ...:
In [10]: c
Out[10]: Counter({1: 1171, 2: 665, 3: 211, 4: 76, 5: 36, 6: 6, 7: 3, 8: 1, 10: 1})

 

Ohjelmanumerot, joista puuttuu ohjelmanjärjestäjän sähköpostiosoite

...