Cleared up the Django 1.8 Warning messages.
parent
25b720c43c
commit
af4843e54b
|
|
@ -231,8 +231,15 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
|
|
||||||
def queryset(self, request):
|
def queryset(self, request):
|
||||||
|
self.get_queryset(request)
|
||||||
|
|
||||||
|
|
||||||
|
def get_queryset(self, request):
|
||||||
# optimize the list display.
|
# optimize the list display.
|
||||||
qs = super(PolymorphicParentModelAdmin, self).queryset(request)
|
try:
|
||||||
|
qs = super(PolymorphicParentModelAdmin, self).get_queryset(request)
|
||||||
|
except:
|
||||||
|
qs = super(PolymorphicParentModelAdmin, self).queryset(request)
|
||||||
if not self.polymorphic_list:
|
if not self.polymorphic_list:
|
||||||
qs = qs.non_polymorphic()
|
qs = qs.non_polymorphic()
|
||||||
return qs
|
return qs
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,13 @@ class PolymorphicManager(models.Manager):
|
||||||
|
|
||||||
super(PolymorphicManager, self).__init__(*args, **kwrags)
|
super(PolymorphicManager, self).__init__(*args, **kwrags)
|
||||||
|
|
||||||
def get_query_set(self):
|
def get_queryset(self):
|
||||||
return self.queryset_class(self.model, using=self._db)
|
return self.queryset_class(self.model, using=self._db)
|
||||||
|
|
||||||
|
def get_query_set(self):
|
||||||
|
return self.get_queryset()
|
||||||
|
|
||||||
|
|
||||||
# Proxy all unknown method calls to the queryset, so that its members are
|
# Proxy all unknown method calls to the queryset, so that its members are
|
||||||
# directly accessible as PolymorphicModel.objects.*
|
# directly accessible as PolymorphicModel.objects.*
|
||||||
# The advantage of this method is that not yet known member functions of derived querysets will be proxied as well.
|
# The advantage of this method is that not yet known member functions of derived querysets will be proxied as well.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue