Commit a82e321d authored by Mario Chirinos's avatar Mario Chirinos

update.sh

parent 7f66b36e
......@@ -57,16 +57,20 @@ class Command(BaseCommand):
os.chdir(options['basedir'][0])
os.chdir(p)
publisher = Publisher.objects.all().filter(shortName=p)
print(publisher.count())
if publisher.count()<=0 and os.path.isfile("settings.json") :
# newPublisher = Publisher()
# newPublisher.shortName=p
print(publisher, "do not exsist")
continue
# [0]
# publisher=
print(p, "do not exsist, crating publisher")
with open('settings.json"', 'r') as f:
cfgfile = json.load(f)
newPublisher = Publisher()
newPublisher.shortName=p
newPublisher.name=cfgfile["name"]
newPublisher.crawler=cfgfile["crawler"]
newPublisher.url=cfgfile["url"]
newPublisher.type="texto"
newPublisher.save()
continue
# publisher=publisher[0]
......
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