OpenSlides/dev-commands/strip-meta-fields.py

13 lines
336 B
Python
Raw Permalink Normal View History

2020-10-16 13:11:00 +02:00
import sys
import json
data = sys.stdin.read()
json_data = json.loads(data)
for collection, models in json_data.items():
for model in models.values():
2020-10-16 13:11:00 +02:00
for field in list(model.keys()):
if field.startswith("meta_"):
del model[field]
sys.stdout.write(json.dumps(json_data, separators=(',', ':')))