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
BDE
Note Kfet 2018
Commits
d9a70dce
Commit
d9a70dce
authored
Aug 26, 2018
by
Hamza Dely
Browse files
[note_kfet/db_initial] Retire les références aux modèles Action/Paiement/Categorie
parent
a466caf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
note_kfet/db_initial.py
View file @
d9a70dce
...
...
@@ -52,20 +52,20 @@ for model, codename, niveau, description in environnement.ACCREDITATIONS:
'niveau'
:
niveau
,
})
## Actions
Action
=
ContentType
.
objects
.
get
(
app_label
=
"consos"
,
model
=
"action"
).
model_class
()
for
action
,
description
in
environnement
.
ACTIONS
:
Action
.
objects
.
get_or_create
(
action
=
action
,
description
=
description
)
## Moyens de paiement
Paiement
=
ContentType
.
objects
.
get
(
app_label
=
"consos"
,
model
=
"paiement"
).
model_class
()
for
moyen
,
description
in
environnement
.
PAIEMENTS
:
Paiement
.
objects
.
get_or_create
(
moyen
=
moyen
,
description
=
description
)
## Catégories
Categorie
=
ContentType
.
objects
.
get
(
app_label
=
"consos"
,
model
=
"categorie"
).
model_class
()
for
nom
,
description
in
environnement
.
CATEGORIES
:
Categorie
.
objects
.
get_or_create
(
nom
=
nom
,
description
=
description
)
##
#
Actions
#
#
Action = ContentType.objects.get(app_label="consos", model="action").model_class()
#
for action, description in environnement.ACTIONS:
#
Action.objects.get_or_create(action=action, description=description)
#
##
#
Moyens de paiement
#
#
Paiement = ContentType.objects.get(app_label="consos", model="paiement").model_class()
#
for moyen, description in environnement.PAIEMENTS:
#
Paiement.objects.get_or_create(moyen=moyen, description=description)
#
##
#
Catégories
#
#
Categorie = ContentType.objects.get(app_label="consos", model="categorie").model_class()
#
for nom, description in environnement.CATEGORIES:
#
Categorie.objects.get_or_create(nom=nom, description=description)
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