Merge pull request #156 from mbehrle/feature/migration
Feature/migration
This commit is contained in:
@@ -15,7 +15,8 @@ class Migration(DataMigration):
|
||||
# NOTE: This migration take a while. Maybe the use of F objects could
|
||||
# improve it.
|
||||
for document in orm.Document.objects.all():
|
||||
document.label = document.versions.order_by('timestamp').last().filename
|
||||
if document.versions.order_by('timestamp').last():
|
||||
document.label = document.versions.order_by('timestamp').last().filename
|
||||
document.save()
|
||||
|
||||
def backwards(self, orm):
|
||||
|
||||
@@ -5,6 +5,9 @@ from django.db import models
|
||||
|
||||
|
||||
class Migration(DataMigration):
|
||||
depends_on = (
|
||||
('actstream', '0007_auto__add_field_follow_started'),
|
||||
)
|
||||
|
||||
def forwards(self, orm):
|
||||
"Write your forwards methods here."
|
||||
|
||||
Reference in New Issue
Block a user