core/migration/tables/comments.py

36 lines
935 B
Python
Raw Normal View History

2021-08-20 09:27:19 +00:00
from html2md import Converter
import datetime
markdown = Converter()
def migrate(entry):
```
# is comment
type Shout {
org: String!
slug: String!
author: Int!
body: String!
createdAt: DateTime!
updatedAt: DateTime!
deletedAt: DateTime
deletedBy: Int
rating: Int
published: DateTime # if there is no published field - it is not published
replyTo: String # another shout
tags: [String] # actual values
topics: [String] # topic-slugs
title: String
versionOf: String
visibleForRoles: [String] # role ids are strings
visibleForUsers: [Int]
}
```
# TODO: implement comments migration
return {
'org': 'discours.io',
'slug': entry['slug'],
'createdAt': entry['createdAt'],
2021-08-20 15:10:15 +00:00
'body': markdown.feed(entry['body']),
2021-08-20 09:27:19 +00:00
'replyTo': entry['']
}