Source

pixels_for_food / pixels / models.py

Full commit
from django.db import models
from django.contrib import admin

# Create your models here.

class Donation (models.Model):
    """ Donation record """
    name = models.CharField(max_length=100, null=True)
    email = models.EmailField(max_length=50, null=True)
    anonymous = models.BooleanField()    
    amount = models.DecimalField(max_digits=5, decimal_places=2)
    donation_date = models.DateTimeField(auto_now_add = True)    
    cause = models.ForeignKey("Cause", related_name="donations")
    
    def __unicode__(self):
        return self.name
admin.site.register(Donation)

class Cause(models.Model):
    """ Charity that recives the donation    """
    name = models.CharField(max_length=100)
    picture = models.CharField(max_length=100, null=True)
    donation_account = models.EmailField()
    link_url = models.URLField()
    active_donation_target = models.BooleanField()
    description = models.TextField(null = True)
    
    def __unicode__(self):
        return self.name
admin.site.register(Cause)