Merge branch 'master' of ssh://k.sfconservancy.org/supporters

This commit is contained in:
Bradley M. Kuhn 2018-01-24 11:48:43 -08:00
commit 9350167d29
2 changed files with 6 additions and 6 deletions

View file

@ -14,6 +14,7 @@ You'll need Python 3, Django, and Ledger::
Create the database::
$ ./manage.py makemigrations supporters
$ ./manage.py migrate
Load data from Ledger. Depending on how you've configured Ledger, you may need to tell it where to find the books with Supporter payments. You can pass additional arguments to configure how the import is done; run the script with the ``--help`` flag for details. A typical first import looks like::

View file

@ -54,12 +54,11 @@ class Date(datetime.date):
return self.adjust_month(1, day=1)
class DateField(models.DateField, metaclass=models.SubfieldBase):
def to_python(self, value):
retval = super().to_python(value)
if retval is not None:
retval = Date.from_pydate(retval)
return retval
class DateField(models.DateField):
def from_db_value(self, value, expression, connection, context):
if value is not None:
value = Date.from_pydate(value)
return value
class Payment(models.Model):