migration wip
This commit is contained in:
parent
3075dbb64b
commit
f756cb9fb6
|
@ -67,5 +67,8 @@ if __name__ == '__main__':
|
||||||
topics()
|
topics()
|
||||||
users()
|
users()
|
||||||
shouts()
|
shouts()
|
||||||
|
elif sys.argv[1] == "bson":
|
||||||
|
import migration.bson2json
|
||||||
|
bson2json.json_tables()
|
||||||
else:
|
else:
|
||||||
print('usage: python migrate.py <all|topics|users|shouts|comments>')
|
print('usage: python migrate.py <all|topics|users|shouts|comments>')
|
|
@ -75,8 +75,6 @@ def migrate(entry):
|
||||||
r['body'] = '<ShoutVideo src=\"' + entry['media'][0]['youtubeId'] + '\" />'
|
r['body'] = '<ShoutVideo src=\"' + entry['media'][0]['youtubeId'] + '\" />'
|
||||||
elif entry.get('type') == 'Music':
|
elif entry.get('type') == 'Music':
|
||||||
r['body'] = '<ShoutMusic media={\"' + json.dumps(entry['media']) +'\"} />'
|
r['body'] = '<ShoutMusic media={\"' + json.dumps(entry['media']) +'\"} />'
|
||||||
else entry.get('type') == 'Image':
|
|
||||||
r['body'] = r['body']
|
|
||||||
else:
|
else:
|
||||||
r['body'] = '## ' + r['title']
|
r['body'] = '## ' + r['title']
|
||||||
# TODO: compile md with graymatter
|
# TODO: compile md with graymatter
|
||||||
|
|
|
@ -26,3 +26,4 @@ class Topic(Base):
|
||||||
parents = relationship(lambda: Topic, secondary=Connection, primaryjoin=slug==Connection.c.parent, secondaryjoin=slug==Connection.c.child, viewonly=True)
|
parents = relationship(lambda: Topic, secondary=Connection, primaryjoin=slug==Connection.c.parent, secondaryjoin=slug==Connection.c.child, viewonly=True)
|
||||||
# list of Topics where the current node is the "parent"
|
# list of Topics where the current node is the "parent"
|
||||||
children = relationship(lambda: Topic, secondary=Connection, primaryjoin=slug==Connection.c.child, secondaryjoin=slug==Connection.c.parent)
|
children = relationship(lambda: Topic, secondary=Connection, primaryjoin=slug==Connection.c.child, secondaryjoin=slug==Connection.c.parent)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user