I have a model with 6 fields, but when I access them using the author field and print the result, it only displays 4 of them, field5 is not shown. The admin shows all fields. My view, model and modelform are below.
if request.POST:
c1 = Datastore.objects.get(author = request.user)
return HttpResponse(c1)
class Datastore(models.Model):
field1 = models.CharField(max_length=100, verbose_name = "")
field2 = models.IntegerField(verbose_name = "")
field3 = models.IntegerField(blank=True, null=True,verbose_name="")
field4 = models.IntegerField(blank=True, null=True, verbose_name = "")
field5 = models.IntegerField(default = 0)
author = models.ForeignKey(User)
class Datastoreform(ModelForm):
"""ModelForm for model: Datastore"""
class Meta:
model = Datastore
exclude = ('author',)
The output is Field1 Field2 Field3 Field4