Commit 7dbf4a3f authored by Mario Chirinos's avatar Mario Chirinos

bulk upload

parent e326991b
......@@ -116,8 +116,10 @@ class Command(BaseCommand):
# topic, created = Topic.objects.get_or_create(name=d['topic'])
# news.topic.add(topic)
topicstr = [d['topic']]
if len(json.dumps(topicstr)) >= 512:
if len(json.dumps(topicstr)) >= 1024:
print(topicstr)
news.topic_raw = json.dumps(topicstr[:4])
else
news.topic_raw = json.dumps(topicstr)
# news.save()
objectsList.append(news)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment