Commits

Mikela Clemmons  committed 1b7b05d

Forked

  • Participants
  • Parent commits 5d0f1f9

Comments (0)

Files changed (1)

File sponsors/models.py

 
 class Sponsor(models.Model):
     name = models.CharField(blank=True, max_length=30)
-    url = models.URLField(verify_exists=True, max_length=200)
-    logo = models.ImageField(upload_to='sponsor_logos')
+    url = models.URLField(blank=True, verify_exists=True, max_length=200)
+    logo = models.ImageField(blank=True, null=True, upload_to='sponsor_logos')
     description = models.TextField(blank=True)
     stype = models.ForeignKey('SponsorType', related_name='sponsors')
-
+    order = models.SmallIntegerField(blank=True, unique=True, 
+                                choices=[(x, x) for x in range(-10, 11)],)
+    
+    class Meta:
+        ordering = ('stype__order', 'order',)
+        
     def __unicode(self):
         return self.name
-
+    
+    
+    
 class SponsorType(models.Model):
     label = models.CharField(max_length=30)
     slug = models.SlugField(max_length=30)
-    
+    order = models.SmallIntegerField(blank=True, unique=True, 
+                                choices=[(x, x) for x in range(-6, 6)],)
+
+    class Meta:
+        ordering = ('order',)
+        
     def __unicode__(self):
         return self.label