##// END OF EJS Templates
Do not try to add an attachment ref for external attachment if there is an internal and external attachment in the same post
Do not try to add an attachment ref for external attachment if there is an internal and external attachment in the same post

File last commit:

r1118:01343b9e default
r1839:4c8bff54 default
Show More
0015_auto_20150420_1331.py
29 lines | 700 B | text/x-python | PythonLexer
/ boards / migrations / 0015_auto_20150420_1331.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import uuid
from django.db import models, migrations
class Migration(migrations.Migration):
def assign_uids(apps, schema_editor):
Post = apps.get_model('boards', 'Post')
for post in Post.objects.all():
post.uid = str(uuid.uuid4())
post.save(update_fields=['uid'])
dependencies = [
('boards', '0014_auto_20150418_1749'),
]
operations = [
migrations.AddField(
model_name='post',
name='uid',
field=models.TextField(default=''),
preserve_default=False,
),
migrations.RunPython(assign_uids),
]