Mercurial > public > sg101
comparison gpp/donations/models.py @ 259:75ea1a8be7f2
Fix some old import problems where I used 'from django.contrib import auth' instead of 'from django.contrib.auth.models import User'. Also some formatting changes while I was in there.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 21 Sep 2010 23:49:05 +0000 |
parents | 9fabeabd89d4 |
children | 2177a71b680c |
comparison
equal
deleted
inserted
replaced
258:f9a9b4014d5b | 259:75ea1a8be7f2 |
---|---|
3 """ | 3 """ |
4 import datetime | 4 import datetime |
5 import decimal | 5 import decimal |
6 | 6 |
7 from django.db import models | 7 from django.db import models |
8 from django.contrib import auth | 8 from django.contrib.auth.models import User |
9 from django.conf import settings | 9 from django.conf import settings |
10 | 10 |
11 | 11 |
12 class DonationManager(models.Manager): | 12 class DonationManager(models.Manager): |
13 def monthly_stats(self, year=None, month=None): | 13 def monthly_stats(self, year=None, month=None): |
44 | 44 |
45 | 45 |
46 class Donation(models.Model): | 46 class Donation(models.Model): |
47 """Model to represent a donation to the website.""" | 47 """Model to represent a donation to the website.""" |
48 | 48 |
49 user = models.ForeignKey(auth.models.User, null=True, blank=True) | 49 user = models.ForeignKey(User, null=True, blank=True) |
50 is_anonymous = models.BooleanField() | 50 is_anonymous = models.BooleanField() |
51 test_ipn = models.BooleanField(default=False, verbose_name="Test IPN") | 51 test_ipn = models.BooleanField(default=False, verbose_name="Test IPN") |
52 txn_id = models.CharField(max_length=20, verbose_name="Txn ID") | 52 txn_id = models.CharField(max_length=20, verbose_name="Txn ID") |
53 txn_type = models.CharField(max_length=64) | 53 txn_type = models.CharField(max_length=64) |
54 first_name = models.CharField(max_length=64, blank=True) | 54 first_name = models.CharField(max_length=64, blank=True) |