Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nk20-scripts
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDE
nk20-scripts
Commits
146260b3
Commit
146260b3
authored
5 years ago
by
Maxime Bombar
Browse files
Options
Downloads
Patches
Plain Diff
Do not hardcode database name and owner
parent
2571477b
No related branches found
No related tags found
1 merge request
!1
Update scripts
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
management/commands/import_nk15.py
+4
-1
4 additions, 1 deletion
management/commands/import_nk15.py
with
4 additions
and
1 deletion
management/commands/import_nk15.py
+
4
−
1
View file @
146260b3
...
@@ -231,13 +231,16 @@ class Command(BaseCommand):
...
@@ -231,13 +231,16 @@ class Command(BaseCommand):
parser
.
add_argument
(
'
-b
'
,
'
--boutons
'
,
action
=
'
store_true
'
,
help
=
"
import boutons
"
)
parser
.
add_argument
(
'
-b
'
,
'
--boutons
'
,
action
=
'
store_true
'
,
help
=
"
import boutons
"
)
parser
.
add_argument
(
'
-t
'
,
'
--transactions
'
,
action
=
'
store_true
'
,
help
=
"
import transaction
"
)
parser
.
add_argument
(
'
-t
'
,
'
--transactions
'
,
action
=
'
store_true
'
,
help
=
"
import transaction
"
)
parser
.
add_argument
(
'
-a
'
,
'
--aliases
'
,
action
=
'
store_true
'
,
help
=
"
import aliases
"
)
parser
.
add_argument
(
'
-a
'
,
'
--aliases
'
,
action
=
'
store_true
'
,
help
=
"
import aliases
"
)
parser
.
add_argument
(
'
-d
'
,
'
--nk15db
'
,
action
=
'
store
'
,
default
=
'
nk15
'
,
help
=
'
NK15 database name
'
)
parser
.
add_argument
(
'
-u
'
,
'
--nk15user
'
,
action
=
'
store
'
,
default
=
'
nk15_user
'
,
help
=
'
NK15 database owner
'
)
def
handle
(
self
,
*
args
,
**
kwargs
):
def
handle
(
self
,
*
args
,
**
kwargs
):
nk15db
,
nk15user
=
kwargs
[
'
nk15db
'
],
kwargs
[
'
nk15user
'
]
#reset database.
#reset database.
call_command
(
"
flush
"
)
call_command
(
"
flush
"
)
self
.
print_success
(
"
flush nk20 database
"
)
self
.
print_success
(
"
flush nk20 database
"
)
# connecting to nk15 database
# connecting to nk15 database
conn
=
pg
.
connect
(
database
=
"
nk15
"
,
user
=
"
nk15
_
user
"
)
conn
=
pg
.
connect
(
database
=
nk15
db
,
user
=
nk15user
)
cur
=
conn
.
cursor
(
cursor_factory
=
pge
.
DictCursor
)
cur
=
conn
.
cursor
(
cursor_factory
=
pge
.
DictCursor
)
if
kwargs
[
"
special
"
]:
if
kwargs
[
"
special
"
]:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment