Revert "wanted to be able to track prospective revenue from info page"

This reverts commit 150ed860c9.
pull/1/head
Andromeda Yelton 2012-12-06 12:37:48 -05:00
parent 150ed860c9
commit 7decd15333
2 changed files with 0 additions and 33 deletions

View File

@ -92,20 +92,5 @@
</dd> </dd>
</dl> </dl>
<h2>Pledges</h2>
<dl>
<dt>How much has been pledged to Unglue.it?</dt>
<dd>
<ul class="terms">
<li>{{ transactions.today.count }} pledges have been made today totaling ${% if transactions.today.sum %}{{ transactions.today.sum }}{% else %}0{% endif %}.
<li>{{ transactions.yesterday.count }} pledges were made yesterday totaling ${% if transactions.yesterday.sum %}{{ transactions.yesterday.sum }}{% else %}0{% endif %}.
<li>{{ transactions.days7.count }} pledges have been made in the past 7 days totaling ${% if transactions.days7.sum %}{{ transactions.days7.sum }}{% else %}0{% endif %}.
<li>{{ transactions.month.count }} pledges have been made in the past month totaling ${% if transactions.month.sum %}{{ transactions.month.sum }}{% else %}0{% endif %}.
<li>{{ transactions.count }} pledges have been made altogether totaling ${{ transactions.sum }}.
</li>
</ul>
</dd>
</dl>
{% endblock %} {% endblock %}

View File

@ -1568,7 +1568,6 @@ class InfoPageView(TemplateView):
users.lt = users.exclude(profile__librarything_id = '') users.lt = users.exclude(profile__librarything_id = '')
users.fb = users.filter(profile__facebook_id__isnull = False) users.fb = users.filter(profile__facebook_id__isnull = False)
users.tw = users.exclude(profile__twitter_id = '') users.tw = users.exclude(profile__twitter_id = '')
works = models.Work.objects works = models.Work.objects
works.today = works.filter(created__range = (date_today(), now())) works.today = works.filter(created__range = (date_today(), now()))
works.days7 = works.filter(created__range = (date_today()-timedelta(days=7), now())) works.days7 = works.filter(created__range = (date_today()-timedelta(days=7), now()))
@ -1581,14 +1580,12 @@ class InfoPageView(TemplateView):
works.wishedby50 = works.filter(num_wishes__gte = 50) works.wishedby50 = works.filter(num_wishes__gte = 50)
works.wishedby10 = works.filter(num_wishes__gte = 10) works.wishedby10 = works.filter(num_wishes__gte = 10)
works.wishedby100 = works.filter(num_wishes__gte = 100) works.wishedby100 = works.filter(num_wishes__gte = 100)
ebooks = models.Ebook.objects ebooks = models.Ebook.objects
ebooks.today = ebooks.filter(created__range = (date_today(), now())) ebooks.today = ebooks.filter(created__range = (date_today(), now()))
ebooks.days7 = ebooks.filter(created__range = (date_today()-timedelta(days=7), now())) ebooks.days7 = ebooks.filter(created__range = (date_today()-timedelta(days=7), now()))
ebooks.year = ebooks.filter(created__year = date_today().year) ebooks.year = ebooks.filter(created__year = date_today().year)
ebooks.month = ebooks.year.filter(created__month = date_today().month) ebooks.month = ebooks.year.filter(created__month = date_today().month)
ebooks.yesterday = ebooks.filter(created__range = (date_today()-timedelta(days=1), date_today())) ebooks.yesterday = ebooks.filter(created__range = (date_today()-timedelta(days=1), date_today()))
wishlists= models.Wishlist.objects.exclude(wishes__isnull=True) wishlists= models.Wishlist.objects.exclude(wishes__isnull=True)
wishlists.today = wishlists.filter(created__range = (date_today(), now())) wishlists.today = wishlists.filter(created__range = (date_today(), now()))
wishlists.days7 = wishlists.filter(created__range = (date_today()-timedelta(days=7), now())) wishlists.days7 = wishlists.filter(created__range = (date_today()-timedelta(days=7), now()))
@ -1598,26 +1595,11 @@ class InfoPageView(TemplateView):
wishlists.yesterday = wishlists.filter(created__range = (date_today()-timedelta(days=1), date_today())) wishlists.yesterday = wishlists.filter(created__range = (date_today()-timedelta(days=1), date_today()))
else: else:
wishlists.yesterday = wishlists.month.filter(created__day = date_today().day-1) wishlists.yesterday = wishlists.month.filter(created__day = date_today().day-1)
transactions = Transaction.objects
transactions.sum = transactions.aggregate(Sum('amount'))['amount__sum']
transactions.today = transactions.filter(date_created__range = (date_today(), now()))
transactions.today.sum = transactions.today.aggregate(Sum('amount'))['amount__sum']
transactions.days7 = transactions.filter(date_created__range = (date_today()-timedelta(days=7), now()))
transactions.days7.sum = transactions.days7.aggregate(Sum('amount'))['amount__sum']
transactions.year = transactions.filter(date_created__year = date_today().year)
transactions.year.sum = transactions.year.aggregate(Sum('amount'))['amount__sum']
transactions.month = transactions.filter(date_created__month = date_today().month)
transactions.month.sum = transactions.month.aggregate(Sum('amount'))['amount__sum']
transactions.yesterday = transactions.filter(date_created__range = (date_today()-timedelta(days=1), date_today()))
transactions.yesterday.sum = transactions.yesterday.aggregate(Sum('amount'))['amount__sum']
return { return {
'users': users, 'users': users,
'works': works, 'works': works,
'ebooks': ebooks, 'ebooks': ebooks,
'wishlists': wishlists, 'wishlists': wishlists,
'transactions': transactions,
} }
class InfoLangView(TemplateView): class InfoLangView(TemplateView):