I can't find nothing similar on this group! Can you please help me? I get this error trace in the django 1.0.2 admin when updating a char primary key in a regex field. Thank you in advance!
Environment: Request Method: POST Request URL: http://localhost/admin/webamf/azienda/04573030659/ Django Version: 1.0.2 final Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.databrowse', 'django.contrib.flatpages', 'retailcenter.webamf'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware') Traceback: File "C:\Django-1.0.2\django\core\handlers\base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File "C:\Django-1.0.2\django\contrib\admin\sites.py" in root 157. return self.model_page(request, *url.split('/', 2)) File "C:\Django-1.0.2\django\views\decorators\cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "C:\Django-1.0.2\django\contrib\admin\sites.py" in model_page 176. return admin_obj(request, rest_of_url) File "C:\Django-1.0.2\django\contrib\admin\options.py" in __call__ 199. return self.change_view(request, unquote(url)) File "C:\Django-1.0.2\django\db\transaction.py" in _commit_on_success 238. res = func(*args, **kw) File "C:\Django-1.0.2\django\contrib\admin\options.py" in change_view 578. instance=new_object) File "C:\Django-1.0.2\django\forms\models.py" in __init__ 468. queryset=qs) File "C:\Django-1.0.2\django\forms\models.py" in __init__ 352. super(BaseModelFormSet, self).__init__(**defaults) File "C:\Django-1.0.2\django\forms\formsets.py" in __init__ 67. self._construct_forms() File "C:\Django-1.0.2\django\forms\models.py" in _construct_forms 474. super(BaseInlineFormSet, self)._construct_forms() File "C:\Django-1.0.2\django\forms\formsets.py" in _construct_forms 76. self.forms.append(self._construct_form(i)) File "C:\Django-1.0.2\django\forms\models.py" in _construct_form 477. form = super(BaseInlineFormSet, self)._construct_form (i, **kwargs) File "C:\Django-1.0.2\django\forms\models.py" in _construct_form 356. kwargs['instance'] = self.get_queryset()[i] File "C:\Django-1.0.2\django\db\models\query.py" in __getitem__ 221. return self._result_cache[k] Exception Type: IndexError at /admin/webamf/azienda/04573030659/ Exception Value: list index out of range this is the code of my admin class class MyAziendaAdminForm(ModelForm): partitaiva = forms.RegexField(regex=r'^(\d{11})$') #ragionesociale = forms.CharField(max_length=50) class Meta: model = Azienda def clean_partitaiva(self): value=self.cleaned_data["partitaiva"] try: vat_number = int(value) except ValueError: raise ValidationError('Partiva IVA non valida') vat_number = str(vat_number).zfill(11) check_digit = vat_number_check_digit(vat_number[0:10]) if not vat_number[10] == check_digit: raise ValidationError('Partita IVA non valida') return value and this is the code for the model class Azienda(models.Model): partitaiva=models.CharField("Partita IVA", max_length=11, primary_key=True) ragionesociale=models.CharField("Ragione Sociale", max_length=50) riferimento=models.CharField (max_length=30,db_column='riferimento',verbose_name='Persona di riferimento',null=True,blank=True) note=models.CharField (max_length=30,db_column='note',null=True,blank=True) def __unicode__(self): return u'%s' % (self.ragionesociale) class Meta: verbose_name = "Azienda Cliente" verbose_name_plural = "Aziende Clienti" ordering = ['ragionesociale'] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

