Commits

Allan Davis  committed 3d5b352

Finished Backend model

  • Participants
  • Parent commits 72b9fd8

Comments (0)

Files changed (3)

File pixels/models.py

 from django.db import models
+from django.contrib import admin
 
 # Create your models here.
 
     """ Donation record """
     name = models.CharField(max_length=100, null=True)
     email = models.EmailField(max_length=50, null=True)
-    Ann
+    anonymous = models.BooleanField()
     donation_date = models.DateTimeField(auto_now_add = True)    
     amount = models.DecimalField(max_digits=5, decimal_places=2)
-    cause = models.ForeginKey("Casue", related_name="donations")
+    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 = CharField(max_length=100)
+    picture = models.CharField(max_length=100)
     donation_url = models.URLField()
     link_url = models.URLField()
     active_donation_target = models.BooleanField()
-    
+    
+    def __unicode__(self):
+        return self.name
+admin.site.register(Cause)
 
 MANAGERS = ADMINS
 
-DATABASE_ENGINE = 'sqlite'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
 DATABASE_NAME = 'development.db'             # Or path to database file if using sqlite3.
 DATABASE_USER = ''             # Not used with sqlite3.
 DATABASE_PASSWORD = ''         # Not used with sqlite3.
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.sites',
+    'django.contrib.admin',
+    'pixels',
 )
 from django.conf.urls.defaults import *
 
 # Uncomment the next two lines to enable the admin:
-# from django.contrib import admin
-# admin.autodiscover()
+from django.contrib import admin
+admin.autodiscover()
 
 urlpatterns = patterns('',
     # Example:
     # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
 
     # Uncomment the next line to enable the admin:
-    # (r'^admin/', include(admin.site.urls)),
+    (r'^admin/', include(admin.site.urls)),
 )