-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Lycee-Experimental/maj_formulaires
Mise à jour des formulaires
- Loading branch information
Showing
14 changed files
with
229 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.idea/ | ||
mediafiles/ | ||
staticfiles/ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,6 @@ | |
}, | ||
{ | ||
"url": "https://github.com/heroku/heroku-geo-buildpack" | ||
}, | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ | |
'leaflet', | ||
'dal_select2', | ||
'dal', | ||
"phonenumber_field", | ||
] | ||
|
||
MIDDLEWARE = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import csv | ||
from django.core.management import BaseCommand | ||
from django.utils import timezone | ||
|
||
from inscription.models import Pays | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "Charge la liste des pays depuis un fichier CSV." | ||
|
||
def handle(self, *args, **options): | ||
start_time = timezone.now() | ||
with open('inscription/data/pays.csv', "r") as csv_file: | ||
data = list(csv.reader(csv_file, delimiter=";")) | ||
for row in data: | ||
Pays.objects.create(code=row[0], name=row[1]) | ||
end_time = timezone.now() | ||
self.stdout.write( | ||
self.style.SUCCESS( | ||
f"Le chargement a pris: {(end_time-start_time).total_seconds()} seconds." | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import csv | ||
from django.core.management import BaseCommand | ||
from django.utils import timezone | ||
|
||
from inscription.models import Sociopro | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "Charge la liste des catégories sociopro depuis un fichier CSV." | ||
|
||
def handle(self, *args, **options): | ||
start_time = timezone.now() | ||
with open('inscription/data/sociopro.csv', "r") as csv_file: | ||
data = list(csv.reader(csv_file, delimiter=";")) | ||
for row in data: | ||
Sociopro.objects.create(code=row[0], name=row[1]) | ||
end_time = timezone.now() | ||
self.stdout.write( | ||
self.style.SUCCESS( | ||
f"Le chargement a pris: {(end_time-start_time).total_seconds()} seconds." | ||
) | ||
) |
Oops, something went wrong.