Utility library which simplifies the creation of Italian applications
Use pypi to install the package
pip install django-italian-utils
Add italian_utils
to installed apps
#...
INSTALLED_APPS = (
# ...
'italian_utils',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
)
# ...
Run migrations
python manage.py migrate
Validators for codice fiscale and partita iva inside your models.
from italian_utils.validators import validate_codice_fiscale, validate_partita_iva
class Persona(models.Model):
codice_fiscale = models.CharField(
max_length=16,
validators=[validate_codice_fiscale]
)
# ...
class Azienda(models.Model):
partita_iva = models.CharField(
max_length=11,
validators=[validate_partita_iva]
)
# ...
A dictionary of Italian region and provinces with abbreviations.
You can import the CSV file containing the list of cities provided by istat with a manage.py command
python manage.py importacomuni <file_csv>
- Link models of cities, provinces and regions using istat codes