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
5a963eb2
Commit
5a963eb2
authored
5 years ago
by
Pierre-antoine Comby
Browse files
Options
Downloads
Patches
Plain Diff
add support for last_negative field
parent
44b27e3a
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
management/commands/import_nk15.py
+5
-0
5 additions, 0 deletions
management/commands/import_nk15.py
with
5 additions
and
0 deletions
management/commands/import_nk15.py
+
5
−
0
View file @
5a963eb2
...
...
@@ -10,6 +10,8 @@ from django.db import transaction
import
collections
from
django.core.exceptions
import
ValidationError
from
django.utils.timezone
import
make_aware
from
django.db
import
IntegrityError
from
django.contrib.auth.models
import
User
from
note.models
import
Note
,
NoteSpecial
,
NoteUser
,
NoteClub
...
...
@@ -101,6 +103,9 @@ def import_comptes(cur,map_idbde):
}
profile
=
Profile
.
objects
.
create
(
**
obj_dict
)
note
=
user
.
note
date
=
row
.
get
(
"
last_negatif
"
,
None
)
if
date
!=
None
:
note
.
last_negative
=
make_aware
(
date
)
note
.
balance
=
row
[
"
solde
"
]
obj_list
=
[
user
,
profile
,
note
]
else
:
# club
...
...
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