After searching a while i didn't find any clear solution
File: models.py
class BaseModel(models.Model):
created_date = models.DateTimeField(auto_now_add=True)
modified_date = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
class Company(BaseModel):
company_name = models.CharField(max_length=50, unique=True)
def __str__(self):
return self.company_name
File: models.py
from django.contrib import admin
from .models import Company
class CompanyAdmin(admin.ModelAdmin):
pass
admin.site.register(Company, CompanyAdmin)
I tried the solution here: Django admin model Inheritance is it possible? but nothing works, and the admin is only showing the company_name