##// END OF EJS Templates
Added support for partial import: when the reply is imported but the original post is not, the reply will be connected after the original post is ready
Added support for partial import: when the reply is imported but the original post is not, the reply will be connected after the original post is ready

File last commit:

r1360:94773499 merge decentral
r1588:b69fb396 default
Show More
0025_auto_20150825_2049.py
28 lines | 850 B | text/x-python | PythonLexer
/ boards / migrations / 0025_auto_20150825_2049.py
neko259
Reflinks to OPs are bold now. Refactored reflinks to build using the same code. Refactored autoescaping
r1309 # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
neko259
Fixed reflink migration. Fixed new_post API when there are not favorite...
r1347 def rebuild_refmap(apps, schema_editor):
Post = apps.get_model('boards', 'Post')
neko259
Reflinks to OPs are bold now. Refactored reflinks to build using the same code. Refactored autoescaping
r1309 for post in Post.objects.all():
neko259
Fixed reflink migration. Fixed new_post API when there are not favorite...
r1347 refposts = list()
for refpost in post.referenced_posts.all():
result = '<a href="{}">&gt;&gt;{}</a>'.format(refpost.get_absolute_url(),
self.id)
if refpost.is_opening():
result = '<b>{}</b>'.format(result)
refposts += result
post.refmap = ', '.join(refposts)
neko259
Reflinks to OPs are bold now. Refactored reflinks to build using the same code. Refactored autoescaping
r1309 post.save(update_fields=['refmap'])
dependencies = [
('boards', '0024_post_tripcode'),
]
operations = [
neko259
Fixed reflink migration. Fixed new_post API when there are not favorite...
r1347 migrations.RunPython(rebuild_refmap),
neko259
Reflinks to OPs are bold now. Refactored reflinks to build using the same code. Refactored autoescaping
r1309 ]