elif "journal" in doc: publisher = doc['journal'] # print publisher else: publisher = None if publisher: try: publisher = Publisher.objects.get(name=publisher) except: publisher = Publisher(name=publisher) publisher.save() document.publisher = publisher else: document.publisher = None if "link" in doc: link = doc['link'] # print link document.link = link document.save() for author in authors: document.authors.add(author) for field in fields: document.fields.add(field) document.projects.add(pro) document.save() # exit() # document = Document(title=title, url=url, description=description, publish_time=publish_time) # document.save()