Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
seda
Commits
ece22f65f9e5
Commit
a73c543c
authored
Oct 14, 2016
by
Sylvain Thénault
Browse files
Use the massive store for initial creation of concept schemes
when the instance's backend is postgres.
parent
488fb224e689
Changes
1
Hide whitespace changes
Inline
Side-by-side
dataimport.py
View file @
ece22f65
...
...
@@ -23,7 +23,6 @@ from os.path import join, dirname
from
six
import
text_type
from
cubicweb.dataimport.stores
import
NoHookRQLObjectStore
from
cubicweb.dataimport.importer
import
SimpleImportLog
from
cubes.skos
import
lcsv
,
sobjects
as
skos
...
...
@@ -108,7 +107,12 @@ def lcsv_check(cnx, store, fname, scheme_uri):
def
import_seda_schemes
(
cnx
,
lcsv_import
=
lcsv_import
):
"""Import all LCSV data files defined in LCSV_FILES"""
store
=
NoHookRQLObjectStore
(
cnx
)
if
cnx
.
repo
.
system_source
.
dbdriver
==
'postgres'
:
from
cubicweb.dataimport.massive_store
import
MassiveObjectStore
store
=
MassiveObjectStore
(
cnx
,
eids_seq_range
=
1000
)
else
:
from
cubicweb.dataimport.stores
import
NoHookRQLObjectStore
store
=
NoHookRQLObjectStore
(
cnx
)
for
title
,
rtypes
,
etypes
,
fname
in
LCSV_FILES
:
if
not
cnx
.
find
(
'ConceptScheme'
,
title
=
title
):
print
(
'importing'
,
title
.
encode
(
'utf-8'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment