code: def changelist_view(self, request, extra_context=None):
          
          model = self.model
          if model.objects.all().count() > 1:
              return super(PreferencesAdmin, self).changelist_view(request)
          else:
              obj = model.singleton.get()
              return redirect(
                  reverse(
                      'admin:%s_%s_change' % (
                          model._meta.app_label, model._meta.model_name
                      ),
                      args=(obj.id,)
                  )
              )
docs: If we only have a single preference object redirect to it,
          otherwise display listing.