Browse Source

added 'unique' attribute to some fields

master
Frederic 11 years ago
parent
commit
e212282be7
  1. 10
      cash/models.py

10
cash/models.py

@ -3,23 +3,23 @@ from django.contrib.auth.models import User @@ -3,23 +3,23 @@ from django.contrib.auth.models import User
class Account(models.Model):
user = models.OneToOneField(User)
card_number = models.CharField(max_length=32)
card_number = models.CharField(max_length=32, unique=True)
pin = models.CharField(max_length=32)
daily_digest = models.BooleanField()
credit = models.IntegerField()
class ProductCategory(models.Model):
name = models.CharField(max_length=32)
name = models.CharField(max_length=32, unique=True)
comment = models.CharField(max_length=128, blank=True)
class Product(models.Model):
name = models.CharField(max_length=32)
name = models.CharField(max_length=32, unique=True)
price = models.IntegerField()
deleted = models.BooleanField()
category = models.ForeignKey(ProductCategory, blank=True, null=True)
class ProductBarcode(models.Model):
barcode = models.CharField(max_length=32)
barcode = models.CharField(max_length=32, unique=True)
comment = models.CharField(max_length=128)
product = models.ForeignKey(Product)
@ -31,7 +31,7 @@ class Transaction(models.Model): @@ -31,7 +31,7 @@ class Transaction(models.Model):
amount = models.IntegerField()
class SalesLogEntry(models.Model):
account = models.ForeignKey(Account)
account = models.ForeignKey(Account)
product = models.ForeignKey(Product)
count = models.IntegerField()
unit_price = models.IntegerField()

Loading…
Cancel
Save