refactor(Contact): rename _civilite_map to civilite_map for better accessibility
This commit is contained in:
parent
c101e45afd
commit
db3776c000
1 changed files with 2 additions and 2 deletions
4
api.py
4
api.py
|
|
@ -150,7 +150,7 @@ class Contact(BaseModel):
|
||||||
linkedin: Optional[str] = Field(None, description="Profil LinkedIn (CT_LinkedIn)")
|
linkedin: Optional[str] = Field(None, description="Profil LinkedIn (CT_LinkedIn)")
|
||||||
skype: Optional[str] = Field(None, description="Identifiant Skype (CT_Skype)")
|
skype: Optional[str] = Field(None, description="Identifiant Skype (CT_Skype)")
|
||||||
|
|
||||||
_civilite_map = {
|
civilite_map = {
|
||||||
0: "M.",
|
0: "M.",
|
||||||
1: "Mme",
|
1: "Mme",
|
||||||
2: "Mlle",
|
2: "Mlle",
|
||||||
|
|
@ -166,7 +166,7 @@ class Contact(BaseModel):
|
||||||
if v is None:
|
if v is None:
|
||||||
return v
|
return v
|
||||||
if isinstance(v, int):
|
if isinstance(v, int):
|
||||||
return cls._civilite_map.get(v, str(v)) # retourne le code en string si non mappé
|
return cls.civilite_map.get(v, str(v)) # retourne le code en string si non mappé
|
||||||
return v
|
return v
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue