Commit c4e0f11b authored by Mario Chirinos's avatar Mario Chirinos

bulk upload

parent 07c635ee
......@@ -107,7 +107,7 @@ class Command(BaseCommand):
if "topic" not in d or d['topic'] == "" or d['topic'] == None or d['topic'] ==[]:
topicstr = ["Sin Tema"]
if type(d['topic'])==list:
elif type(d['topic'])==list:
topicstr = d['topic']
# for t in d['topic']:
## topic, created = Topic.objects.all().get_or_create(name=t)
......@@ -117,6 +117,7 @@ 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)) >= 1024:
print(topicstr)
news.topic_raw = json.dumps(topicstr[:4])
......
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