I would like to take my User model and break it down by day, using the date_joined field. Django’s aggregation seems to be a good fit, but im not sure how to use this with a DateField object. I believe I also want the values to compound.
My goal is to get a whole number for each day since the very first signup to the most present (and continuing). I think I want this in compound form, so for example, if the first day i have 100 signups and the day after is 80, I want the second days total to be 180. This way I can see the userbase grow/drop over time and not just see signup spikes and then flatline on days that there are no signups.
Pretty set on using Highcharts for the graphing. Here is a live example of the graph I wish to implement, only using Apple stock data but it’s more or less what I want, only with daily amounts of user signup. http://www.highcharts.com/stock/demo/basic-line
I can build a QuerySet of a single instance with the following example. This isn’t a very realistic approach going forward though. I’d like to dynamically calculate these figures, not manually assign them.
y2007m09d01=(user_list.filter(date_joined__year="2007").filter(date_joined__month="9").filter(date_joined__day="1").count())
y2007m09d02=(user_list.filter(date_joined__year="2007").filter(date_joined__month="9").filter(date_joined__day="1").count() + y2007m09d01)
There might be some “all django” solution to this, but if not you can just use itertools.groupby over the list of users. I’m thinking something like this: