diff options
Diffstat (limited to 'app/stuff/models.py')
-rw-r--r-- | app/stuff/models.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/app/stuff/models.py b/app/stuff/models.py deleted file mode 100644 index 70b7366..0000000 --- a/app/stuff/models.py +++ /dev/null @@ -1,43 +0,0 @@ -from django.db import models -from django.utils.encoding import force_unicode -from django.conf import settings -ITEM_TYPES = ( - (0, 'Book'), - (1, 'Apparel'), - (2, 'Gadget'), - (3, 'Furniture'), - ) - -class Item(models.Model): - isbn = models.CharField(max_length=100, blank=True, null=True) - serial_number = models.CharField(max_length=100, blank=True, null=True) - type = models.IntegerField(choices=ITEM_TYPES, default=0) - title = models.CharField(max_length=200) - creator = models.CharField(max_length=200, blank=True, null=True) - creator_sort_last_name = models.CharField(max_length=200, blank=True, null=True) - creator_sort_first_name = models.CharField(max_length=200, blank=True, null=True) - current_price = models.DecimalField(max_digits=8, decimal_places=2, blank=True, null=True) - retail_price = models.DecimalField(max_digits=8, decimal_places=2, blank=True, null=True) - purchase_price = models.DecimalField(max_digits=8, decimal_places=2, blank=True, null=True) - amazon_url = models.CharField(max_length=400,blank=True, null=True) - image_url = models.CharField(max_length=400,blank=True, null=True) - image = models.FileField(upload_to='stuff/', null=True,blank=True) - format = models.CharField(max_length=255, blank=True, null=True) - date_released = models.DateTimeField(blank=True, null=True) - date_purchased = models.DateTimeField(blank=True, null=True) - date_added = models.DateTimeField(blank=True, null=True) - - class Meta: - ordering = ['-date_added'] - - def __unicode__(self): - return self.title - - def get_image_url(self): - return '%s%s' %(settings.MEDIA_URL,self.image) - - def admin_thumbnail(self): - return force_unicode('<a href=""><img src="%s" width="100" style="width:100px"></a>' % (self.get_image_url())) - admin_thumbnail.allow_tags = True - admin_thumbnail.short_description = 'Thumbnail' - |