mark instance as extra on update

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

View file

@ -25,7 +25,6 @@ from person.models import get_name_sort
import extract
class File(models.Model):
created = models.DateTimeField(auto_now_add=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])
updated=True
if updated:
if instance.name.lower().startswith('extras/') or \
instance.name.lower().startswith('versions/'):
instance.extra = True
instance.save()
instance.file.save()
else: