diff options
author | luxagraf <sng@luxagraf.net> | 2016-12-31 14:44:41 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2016-12-31 14:44:41 -0500 |
commit | 30ae846aa96aeb2037301e4abcb33c2b392c3548 (patch) | |
tree | a5b8ff9667416dc847307b4863a77784933e7d28 /app/ebay/models.py | |
parent | 940412cc4b934c8bc48e5cb7939afa681cc8be0a (diff) |
added amount desired
Diffstat (limited to 'app/ebay/models.py')
-rw-r--r-- | app/ebay/models.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/ebay/models.py b/app/ebay/models.py index 38f8e1c..26b004e 100644 --- a/app/ebay/models.py +++ b/app/ebay/models.py @@ -21,10 +21,22 @@ class Item(models.Model): class TrackedItem(models.Model): - url = models.CharField(max_length=200) title = models.CharField(max_length=200) + url = models.CharField(max_length=200) + DESIRE = ( + (0, '1'), + (1, '2'), + (2, '3'), + (3, '4'), + (4, '5'), + ) + amount_desired = models.IntegerField(choices=DESIRE, default=0) date_ending = models.DateTimeField(default=timezone.now) + class Meta: + ordering = ('-date_ending', 'amount_desired') + get_latest_by = 'date_ending' + def save(self, **kwargs): super(TrackedItem, self).save() |