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
11e8b66a
Commit
11e8b66a
authored
5 years ago
by
Pierre-antoine Comby
Browse files
Options
Downloads
Patches
Plain Diff
use Note Parent Polymorphic id for consistency
parent
fa0ac589
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
management/commands/import_nk15.py
+4
-4
4 additions, 4 deletions
management/commands/import_nk15.py
with
4 additions
and
4 deletions
management/commands/import_nk15.py
+
4
−
4
View file @
11e8b66a
...
...
@@ -18,8 +18,8 @@ from django.db import IntegrityError
from
django.contrib.auth.models
import
User
from
note.models
import
Note
,
NoteSpecial
,
NoteUser
,
NoteClub
from
note.models
import
Alias
from
note.models
import
T
ransaction
,
TransactionTemplate
,
\
T
emplateCategory
,
RecurrentTransaction
,
MembershipTransaction
from
note.models
import
T
emplateCategory
,
TransactionTemplate
,
\
T
ransaction
,
RecurrentTransaction
,
MembershipTransaction
,
SpecialTransaction
from
member.models
import
Profile
,
Club
,
Membership
"""
...
...
@@ -115,7 +115,7 @@ def import_comptes(cur):
club
.
save
()
note
.
save
()
MAP_IDBDE
[
row
[
"
idbde
"
]]
=
note
.
pk
MAP_IDBDE
[
row
[
"
idbde
"
]]
=
note
.
note_ptr_id
@transaction.atomic
def
import_boutons
(
cur
):
...
...
@@ -141,7 +141,7 @@ def import_boutons(cur):
except
IntegrityError
as
e
:
# button with the same name is not possible in NK20.
if
"
unique
"
in
e
.
args
[
0
]:
qs
=
Club
.
objects
.
filter
(
note__
id
=
MAP_IDBDE
[
row
[
"
destinataire
"
]]).
values
(
'
name
'
)
qs
=
Club
.
objects
.
filter
(
note__
note_ptr
=
MAP_IDBDE
[
row
[
"
destinataire
"
]]).
values
(
'
name
'
)
note_name
=
qs
[
0
][
"
name
"
]
#rename button name
obj_dict
[
"
name
"
]
=
"
{} {}
"
.
format
(
obj_dict
[
"
name
"
],
note_name
)
...
...
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