def get_queryset(self, obj):
        if self.queryset is not None:
            queryset = self.queryset
            if hasattr(queryset, '_clone'):
                queryset = queryset._clone()
        elif self.model is not None:
            queryset = self.model._default_manager.all()
        else:
            raise ImproperlyConfigured(u"'%s' must define 'queryset' or 'model'"
                                       % self.__class__.__name__)

        if hasattr(queryset, 'using_translations'):
            queryset = queryset.using_translations()

        obj_field = self.get_obj_field(obj)
        if hasattr(self.get_model(), obj_field):
            extra_filter = {obj_field: obj}
            queryset = queryset.filter(**extra_filter)

        # Sortable Items
        if self.sortable:
            queryset = queryset.order_by(self.sortable_field)
        else:
            # Ordering Items
            if self.ordering:
                if isinstance(self.ordering, tuple) \
                        or isinstance(self.ordering, list):
                    queryset = queryset.order_by(*self.ordering)
                else:
                    queryset = queryset.order_by(self.ordering)
            else:
                # If no specific ordering, we try to use default Meta.ordering field.
                try:
                    meta_ordering = self.model._meta.ordering
                except __HOLE__:
                    # Else we order by the primary key
                    meta_ordering = None
                if meta_ordering:
                    queryset = queryset.order_by(*meta_ordering)
                else:
                    queryset = queryset.order_by('pk')
        return queryset
dataset/ETHPy150Open ionyse/ionyweb/ionyweb/administration/actions/views.py/ActionAdminListView.get_queryset