0001-mdel-add-a-software-parameter-36870.patch
passerelle/apps/mdel/migrations/0006_mdel_software.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# Generated by Django 1.11.18 on 2019-11-18 17:18 |
|
3 |
from __future__ import unicode_literals |
|
4 | ||
5 |
from django.db import migrations, models |
|
6 | ||
7 | ||
8 |
class Migration(migrations.Migration): |
|
9 | ||
10 |
dependencies = [ |
|
11 |
('mdel', '0005_remove_mdel_log_level'), |
|
12 |
] |
|
13 | ||
14 |
operations = [ |
|
15 |
migrations.AddField( |
|
16 |
model_name='mdel', |
|
17 |
name='software', |
|
18 |
field=models.CharField(choices=[(b'SIECLE', b'SIECLE (LOGITUD)'), (b'MELODIE', b'MELODIE (ARPEGE)')], default=b'SIECLE', max_length=30, verbose_name='Destination software'), |
|
19 |
), |
|
20 |
] |
passerelle/apps/mdel/models.py | ||
---|---|---|
27 | 27 | |
28 | 28 |
from . import mdel |
29 | 29 | |
30 |
from .utils import zipdir, get_file_content_from_zip, parse_date |
|
30 |
from .utils import zipdir, get_file_content_from_zip, parse_date, MELODIE, SIECLE
|
|
31 | 31 | |
32 | 32 | |
33 | 33 |
DEMAND_TYPES = ['ILE-LA', 'RCO-LA', 'AEC-LA'] |
... | ... | |
74 | 74 |
- Recensement Citoyen Obligatoire (RCO-LA) |
75 | 75 |
""" |
76 | 76 |
category = _('Civil Status Connectors') |
77 |
software = models.CharField( |
|
78 |
_('Destination software'), max_length=30, |
|
79 |
choices=[(SIECLE, 'SIECLE (LOGITUD)'), (MELODIE, 'MELODIE (ARPEGE)')], |
|
80 |
default=SIECLE, |
|
81 |
) |
|
77 | 82 | |
78 | 83 |
class Meta: |
79 | 84 |
verbose_name = 'Mes Demarches En Ligne' |
passerelle/apps/mdel/utils.py | ||
---|---|---|
22 | 22 | |
23 | 23 |
from passerelle.utils.jsonresponse import APIError |
24 | 24 | |
25 | ||
26 |
MELODIE = 'MELODIE' |
|
27 |
SIECLE = 'SIECLE' |
|
28 | ||
29 | ||
25 | 30 |
def parse_date(date): |
26 | 31 |
try: |
27 | 32 |
parsed_date = django_parse_date(date) |
28 |
- |