Fields Don't show in django admin While trying to add role through django admin it doesn't show the field
class Role(Core):
role = models.CharField(max_length=25, unique=True, editable=False)
def save(self, *args, **kwargs):
self.role = self.role.lower()
super(Role, self).save(*args, **kwargs)
def __str__(self):
return self.role.capitalize()
admin.site.register(Role)
class Core(models.Model):
id = models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
Core
before theRole
.id
is given by the database (it is the primary key) and thecreated_at
andupdated_at
are items that are non-editable, so these will not show in the form either.editable=False
, so as said above none would show up...