[billreminder] Added initial database model.
- From: Og B. Maciel <ogmaciel src gnome org>
- To: svn-commits-list gnome org
- Subject: [billreminder] Added initial database model.
- Date: Fri, 1 May 2009 09:37:00 -0400 (EDT)
commit 1c2e4a852bbaab4c0d1b8de66a6a3b750b845e3a
Author: Og Maciel <ogmaciel gnome org>
Date: Fri May 1 09:35:11 2009 -0400
Added initial database model.
---
src/bills/models.py | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 47 insertions(+), 1 deletions(-)
diff --git a/src/bills/models.py b/src/bills/models.py
index 71a8362..d3f1c92 100644
--- a/src/bills/models.py
+++ b/src/bills/models.py
@@ -1,3 +1,49 @@
from django.db import models
-# Create your models here.
+class Category(models.Model):
+ """
+ Represents the category for a payment.
+ """
+
+ categoryName = models.CharField(
+ "Category", max_length=50, null=False, blank=False
+ )
+
+ categoryColor = models.CharField(
+ "Color", max_length=14, null=True, blank=True
+ )
+
+ def __unicode__(self):
+ return self.categoryName
+
+class Bill(models.Model):
+ """
+ Represents a payment transaction.
+ """
+
+ category = models.ForeignKey(
+ Category, null=True, blank=True
+ )
+
+ payee = models.CharField(
+ "Payee", max_length=50, null=False, blank=False
+ )
+
+ dueDate = models.DateTimeField(
+ "Due Date", null=False, blank=False
+ )
+
+ amountDue = models.DecimalField(
+ "Amount", null=False, blank=False, max_digits=19, decimal_places=2
+ )
+
+ notes = models.TextField(
+ "Notes", null=True, blank=True
+ )
+
+ paid = models.BooleanField(
+ "Paid", default=False
+ )
+
+ def __unicode__(self):
+ return self.payee
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]