fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
was throwing TypeError("save() got an unexpected keyword argument 'using'",)
[wolnelektury.git]
/
scripts
/
import_links.py
diff --git
a/scripts/import_links.py
b/scripts/import_links.py
index
ea4380f
..
0bc190e
100644
(file)
--- a/
scripts/import_links.py
+++ b/
scripts/import_links.py
@@
-1,3
+1,8
@@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
import sys
sys.path.insert(0, '../apps')
sys.path.insert(0, '../lib')
import sys
sys.path.insert(0, '../apps')
sys.path.insert(0, '../lib')
@@
-13,7
+18,7
@@
setup_environ(settings)
from catalogue.models import Book, Tag
from catalogue.models import Book, Tag
-def import_
tag
s(file_name, attribute):
+def import_
link
s(file_name, attribute):
for line in file(file_name):
slug, link = line.split()
link = link.strip('\n')
for line in file(file_name):
slug, link = line.split()
link = link.strip('\n')
@@
-32,5
+37,5
@@
def import_tags(file_name, attribute):
print 'Invalid slug %s!' % slug
print 'Invalid slug %s!' % slug
-import_
tag
s('gazeta-links', 'gazeta_link')
-
+import_
link
s('gazeta-links', 'gazeta_link')
+import_links('wiki-links', 'wiki_link')