| 3881 | # ITZipCodeField ############################################################# |
| 3882 | |
| 3883 | >>> from django.contrib.localflavor.it.forms import ITZipCodeField |
| 3884 | >>> f = ITZipCodeField() |
| 3885 | >>> f.clean('00100') |
| 3886 | u'00100' |
| 3887 | >>> f.clean(' 00100') |
| 3888 | Traceback (most recent call last): |
| 3889 | ... |
| 3890 | ValidationError: [u'Enter a zip code in the format XXXXX.'] |
| 3891 | |
| 3892 | # ITRegionSelect ############################################################# |
| 3893 | |
| 3894 | >>> from django.contrib.localflavor.it.forms import ITRegionSelect |
| 3895 | >>> w = ITRegionSelect() |
| 3896 | >>> w.render('regions', 'PMN') |
| 3897 | u'<select name="regions">\n<option value="ABR">Abruzzo</option>\n<option value="BAS">Basilicata</option>\n<option value="CAL">Calabria</option>\n<option value="CAM">Campania</option>\n<option value="EMR">Emilia-Romagna</option>\n<option value="FVG">Friuli-Venezia Giulia</option>\n<option value="LAZ">Lazio</option>\n<option value="LIG">Liguria</option>\n<option value="LOM">Lombardia</option>\n<option value="MAR">Marche</option>\n<option value="MOL">Molise</option>\n<option value="PMN" selected="selected">Piemonte</option>\n<option value="PUG">Puglia</option>\n<option value="SAR">Sardegna</option>\n<option value="SIC">Sicilia</option>\n<option value="TOS">Toscana</option>\n<option value="TAA">Trentino-Alto Adige</option>\n<option value="UMB">Umbria</option>\n<option value="VAO">Valle d\u2019Aosta</option>\n<option value="VEN">Veneto</option>\n</select>' |
| 3898 | |