Skip to content

Instantly share code, notes, and snippets.

Last active December 11, 2015 23:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Transaction, Merchant and Category object model from my personal finance mini-hackathon
class Category(models.Model):
name = models.CharField(max_length=255)
class Merchant(models.Model):
name = models.CharField(max_length=255)
category = models.ForeignKey(Category, blank=True, null=True, db_index=True)
class Transaction(models.Model):
transaction_date = models.DateTimeField(db_index=True)
posting_date = models.DateTimeField(null=True)
billing_amount = models.FloatField(max_length=255)
merchant_raw = models.CharField(max_length=255)
merchant = models.ForeignKey(Merchant, db_index=True)
merchant_town = models.CharField(max_length=255)
merchant_county = models.CharField(max_length=255)
merchant_postcode = models.CharField(max_length=255)
reference_number = models.CharField(max_length=255)
debit_credit_flag = models.CharField(max_length=255)
sicmcc_code = models.CharField(max_length=255)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment