hello,
I have noticed a strange behaviour with my project. I have created a class with different attributes
class basket (models.Model):
id=models.AutoField(primary_key=True)
pear=models.DecimalField(max_digits=25, decimal_places=20)
Apple=models.DecimalField(max_digits=25, decimal_places=20)
orange=models.DecimalField(max_digits=25, decimal_places=20)
then I created my form for this model
class basket_form(forms.ModelForm):
class Meta:
model = basket
exclude=('pear','Apple','orange')
Everything works fine, but I notice that I capitalized the attribute “Apple” and for a more consistent coding, I decided to change the case of the first letter of my attribute “Apple” everywhere in my code. Everything is fine, except this form.
I get a " KeyError at /" error message while loading the form.
if I capitalize again the attribute in the “exclude”, everything is working again.
I tried to delete the cache and redo the migration from scratch, still the same error.
I don’t really understand whats going on here, if anyone can help?
thank you,
tibibs