Commits

Kevin Veroneau committed 09fd8ca Draft

Added ImageField to Screenshots.

Comments (0)

Files changed (1)

     posted = models.DateTimeField(auto_now_add=True)
     def __unicode__(self):
         return u"%s" % self.username
-    def save(self, commit=True):
+    def save(self, **kwargs):
         self.username = self.owner.username
-        return super(CustomComment, self).save(commit)
+        return super(CustomComment, self).save(**kwargs)
 
 class EngineVersion(models.Model):
     codename = models.CharField(max_length=60, help_text='Codename for this version of the game engine.')
     bio = models.TextField(blank=True, help_text='Optional, but highly recommended.')
     def __unicode__(self):
         return u"%s" % self.known_as
-    def save(self, commit=True):
+    def save(self, **kwargs):
         if self.known_as == '':
             self.known_as = self.owner.username
-        return super(Writer, self).save(commit)
+        return super(Writer, self).save(**kwargs)
 
 class Artist(models.Model):
     owner = models.ForeignKey(User, blank=True, null=True, help_text='Is this artist part of this community?')
     website = models.URLField(blank=True, help_text='Does this artist have a online portfolio somewhere?')
     def __unicode__(self):
         return u"%s" % self.known_as
-    def save(self, commit=True):
+    def save(self, **kwargs):
         if self.known_as == '':
             self.known_as = self.owner.username
-        return super(Artist, self).save(commit)
+        return super(Artist, self).save(**kwargs)
 
 class Composer(models.Model):
     owner = models.ForeignKey(User, blank=True, null=True, help_text='Is this composer part of this community?')
     website = models.URLField(blank=True, help_text='Does this composer have a online portfolio somewhere?')
     def __unicode__(self):
         return u"%s" % self.known_as
-    def save(self, commit=True):
+    def save(self, **kwargs):
         if self.known_as == '':
             self.known_as = self.owner.username
-        return super(Composer, self).save(commit)
+        return super(Composer, self).save(**kwargs)
 
 class GameDownload(models.Model):
     GAME_WORKFLOW = (
         return "%s %s %s" % (self.title, self.version, self.get_classification_display())
 
 class Screenshot(models.Model):
+    image = models.ImageField(upload_to='game_screenshots')
     title = models.CharField(max_length=128, help_text='A title for this image?')
     is_public = models.BooleanField(default=True)
     is_title = models.BooleanField(help_text='Is this a title screen for the game?')
     updated_on = models.DateField(auto_now=True)
     def __unicode__(self):
         return u"%s" % self.title
-    def save(self, commit=True):
+    def save(self, **kwargs):
         if self.slug == '':
             self.slug = slugify(self.title)
         if self.author == '':
             self.author = self.owner.username
-        return super(Game, self).save(commit)
+        return super(Game, self).save(**kwargs)