This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
981 additions
and
199 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
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,12 @@ | ||
import re | ||
|
||
from unidecode import unidecode | ||
|
||
|
||
def convert_string_to_api_key(string): | ||
# Convert to lower and remove accents | ||
string = unidecode(string.lower()) | ||
# Delete special characters and spaces | ||
string = re.sub("[^a-z0-9_ ]", "", string) | ||
string = string.replace(" ", "_") | ||
return string |
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
55 changes: 55 additions & 0 deletions
55
geocity/apps/forms/migrations/0021_field_api_name_form_api_name.py
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,55 @@ | ||
# Generated by Django 4.2.1 on 2023-06-14 13:15 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("forms", "0020_map_widget_configuration"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="field", | ||
name="api_name", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="Se génère automatiquement lorsque celui-ci est vide.", | ||
max_length=255, | ||
verbose_name="Nom dans l'API", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="form", | ||
name="api_name", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="Se génère automatiquement lorsque celui-ci est vide.", | ||
max_length=255, | ||
verbose_name="Nom dans l'API", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="field", | ||
name="input_type", | ||
field=models.CharField( | ||
choices=[ | ||
("address", "Adresse"), | ||
("checkbox", "Case à cocher"), | ||
("list_multiple", "Choix multiple"), | ||
("list_single", "Choix simple"), | ||
("date", "Date"), | ||
("file", "Fichier"), | ||
("file_download", "Fichier (à télécharger)"), | ||
("number", "Nombre"), | ||
("text", "Texte"), | ||
("regex", "Texte (regex)"), | ||
("text_output", "Texte à afficher"), | ||
("title_output", "Titre à afficher"), | ||
], | ||
max_length=30, | ||
verbose_name="type de caractéristique", | ||
), | ||
), | ||
] |
Oops, something went wrong.