I have model as
class Employer(models.Model):
create_user = models.ForeignKey(User,unique=False,null=True, related_name='%(class)s_user_create')
update_user = models.ForeignKey(User,unique=False,null=True, related_name='%(class)s_user_update')
and I would like to list all Employer
objects while I was at details of user in Django admin panel.
I have written something like
admin.py
class EmployerInline(admin.TabularInline):
model = Employer
class UserAdmin(admin.ModelAdmin):
inlines = [
EmployerInline
]
admin.site.register(UserAdmin)
but it gives me error as 'MediaDefiningClass' object is not iterable
How can I list employers that are created by a spesific user while I was looking for user's details ?
Thanks