In my admin.py I have:
class SayfaAdmin(admin.ModelAdmin):
def queryset(self, request):
qs = super(SayfaAdmin, self).queryset(request)
....
But, instead 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 can I get modelAdmin class (SayfaAdmin in my example), so I can call the function with parameters (request, self and modeladmin) ?
Why can’t you call it with
self?