Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sage Validation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
geant-swd
Sage Validation
Commits
67579b5c
Commit
67579b5c
authored
3 months ago
by
Neda Moeini
Browse files
Options
Downloads
Patches
Plain Diff
Update forms.py based on the models update.
parent
e17906e5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sage_validation/file_validator/forms.py
+6
-6
6 additions, 6 deletions
sage_validation/file_validator/forms.py
with
6 additions
and
6 deletions
sage_validation/file_validator/forms.py
+
6
−
6
View file @
67579b5c
...
@@ -7,7 +7,7 @@ from typing import ClassVar
...
@@ -7,7 +7,7 @@ from typing import ClassVar
from
django
import
forms
from
django
import
forms
from
django.core.files.uploadedfile
import
UploadedFile
from
django.core.files.uploadedfile
import
UploadedFile
from
sage_validation.file_validator.models
import
Meo
c
ost
c
entres
,
Meo
v
alid
s
age
accounts
,
Pl
Account
Code
s
,
XxData
from
sage_validation.file_validator.models
import
Meo
C
ost
C
entres
,
Meo
V
alid
S
ageAccounts
,
XxData
,
MeoValidSuppliers
class
CSVUploadForm
(
forms
.
Form
):
class
CSVUploadForm
(
forms
.
Form
):
...
@@ -151,8 +151,8 @@ class CSVUploadForm(forms.Form):
...
@@ -151,8 +151,8 @@ class CSVUploadForm(forms.Form):
errors
=
[]
errors
=
[]
account_code_map
=
{
account_code_map
=
{
obj
.
pl
_account_
code
:
obj
.
pl
_account_name
obj
.
supplier
_account_
number
:
obj
.
supplier
_account_name
for
obj
in
PlAccountCode
s
.
objects
.
using
(
"
meo
"
).
all
()
# type: ignore[attr-defined]
for
obj
in
MeoValidSupplier
s
.
objects
.
using
(
"
meo
"
).
all
()
# type: ignore[attr-defined]
}
}
for
index
,
row
in
enumerate
(
data
,
start
=
1
):
for
index
,
row
in
enumerate
(
data
,
start
=
1
):
...
@@ -188,7 +188,7 @@ class CSVUploadForm(forms.Form):
...
@@ -188,7 +188,7 @@ class CSVUploadForm(forms.Form):
errors
=
[]
errors
=
[]
cost_centre_map
=
{
cost_centre_map
=
{
obj
.
cc
:
obj
.
cctype
for
obj
in
Meo
c
ost
c
entres
.
objects
.
using
(
"
meo
"
).
all
()
obj
.
cc
:
obj
.
cc
_
type
for
obj
in
Meo
C
ost
C
entres
.
objects
.
using
(
"
meo
"
).
all
()
}
}
xx_data_map
=
{
xx_data_map
=
{
...
@@ -216,8 +216,8 @@ class CSVUploadForm(forms.Form):
...
@@ -216,8 +216,8 @@ class CSVUploadForm(forms.Form):
nc
=
xx_data
[
0
]
if
cc_type
==
"
Project
"
else
xx_data
[
1
]
nc
=
xx_data
[
0
]
if
cc_type
==
"
Project
"
else
xx_data
[
1
]
if
not
Meo
v
alid
s
age
a
ccounts
.
objects
.
using
(
"
meo
"
).
filter
(
if
not
Meo
V
alid
S
age
A
ccounts
.
objects
.
using
(
"
meo
"
).
filter
(
accountcostcentre
=
cc
,
accountdepartment
=
dep
,
accountnumber
=
nc
account
_
cost
_
centre
=
cc
,
account
_
department
=
dep
,
account
_
number
=
nc
).
exists
():
).
exists
():
errors
.
append
(
errors
.
append
(
f
"
Row
{
index
}
: The combination of
'
NominalAnalysisNominalCostCentre/1
'
(
{
cc
}
),
"
f
"
Row
{
index
}
: The combination of
'
NominalAnalysisNominalCostCentre/1
'
(
{
cc
}
),
"
...
...
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