Site Sections: Satchmo Main | Wiki | Demo Store |

root/satchmoproject.com/satchmo_website/apps/misc_apps/models.py

Revision 1065, 0.9 kB (checked in by chris, 1 year ago)

Adding website thumbnails to front page.

  • Property svn:executable set to *
Line 
1 from django.db import models
2 from satchmo.thumbnail.field import ImageWithThumbnailField
3
4 class SatchmoStore(models.Model):
5     name = models.CharField(help_text="Store Name", max_length=50)
6     description = models.CharField(max_length=100, blank=True, null=True)
7     date_added = models.DateTimeField()
8     visible = models.BooleanField(default=True)
9     url = models.URLField()
10     owner = models.CharField(max_length=100)
11     owner_email = models.EmailField(blank=True, null=True)
12     picture = ImageWithThumbnailField(verbose_name="Thumbnail", upload_to="images")
13     def __unicode__(self):
14         return self.name
15    
16     class Meta:
17         get_latest_by = "date_added"
18         ordering = ["name"]
19         verbose_name = "Sample Store"
20         verbose_name_plural = "Sample Stores"
21        
22     class Admin:
23         date_hierarchy = 'date_added'
24         list_display = ('name', 'visible')
25         list_filter = ('visible',)
26        
Note: See TracBrowser for help on using the browser.