mark instance as extra on update

This commit is contained in:
j 2011-08-27 09:03:33 +02:00
parent b960a94711
commit f06164b151
2 changed files with 3 additions and 1 deletions

View file

@ -25,7 +25,6 @@ from person.models import get_name_sort
import extract import extract
class File(models.Model): class File(models.Model):
created = models.DateTimeField(auto_now_add=True) created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True) modified = models.DateTimeField(auto_now=True)

View file

@ -50,6 +50,9 @@ def update_or_create_instance(volume, f):
setattr(instance, key, f[key]) setattr(instance, key, f[key])
updated=True updated=True
if updated: if updated:
if instance.name.lower().startswith('extras/') or \
instance.name.lower().startswith('versions/'):
instance.extra = True
instance.save() instance.save()
instance.file.save() instance.file.save()
else: else: