In my admin.py i have:
class SayfaAdmin(admin.ModelAdmin):
def queryset(self, request):
qs = super(SayfaAdmin, self).queryset(request)
....
But, insteead of defining same queryset function, i wish to write a function which will be called within admin class and returns the result so, instead of writing something as above, i wish to write:
class SayfaAdmin(admin.ModelAdmin):
def queryset(self, request):
qs = somefunc()
def somefunc():
...
return somevalue
My problem is, how acn i get modelAdmin class (SayfaAdmin in my example), so i can call the fuction with parameters (request, self and modeladmin) ?