Posts

Showing posts with the label django-models

Django model to admin, integer fields and textfield are not visible in admin section

Image
Django model to admin, integer fields and textfield are not visible in admin section class Student(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) father_name = models.CharField(max_length=60) age = models.SmallIntegerField created = models.DateTimeField(auto_now=False, auto_now_add=True) modified = models.DateTimeField(auto_now=True, auto_now_add=False) address = models.TextField email = models.EmailField(default="") id = models.AutoField std = models.SmallIntegerField remarks = models.TextField I have created a model called Student and added it to Django admin and migrated it. There was no problem with migration. When I tried to add a new student via admin page, I am only getting following fields, How can I get integer fields like age in UI? It should be age = models.SmallIntegerField() . Note () signs. Just add it for all fields and run makemigr...