title: Django REST ViewSet ordering for Null-able columns
body: <p>Consider a table Person:</p>
  
  <pre><code>| name | wealth |
  |------| ------ |
  |Abby  | 12     |
  |Ben   | Null   |
  |Carl  | 5      |
  |Diane | Null   |
  </code></pre>
  
  <p>We want to sort the rows by wealth, descending, i.e. to get <code>(Abby, Carl, Ben, Diane)</code>, but Django's <code>order_by</code> function sorts them by Null first:</p>
  
  <pre><code>class PersonViewSet(serializers.ModelViewSet):
          serializer_class = PersonSerializer
          queryset = Person.objects.all().order_by('-wealth)
  </code></pre>
  
  <p>gives <code>(Ben, Diane, Abby, Carl)</code>, i.e. it first lists the Null values then sorts by wealth. </p>
  
  <hr>
  
  <p>I tried redefining the <code>get_queryset</code> method:</p>
  
  <pre><code>class PersonViewSet(serializers.ModelViewSet):
      serializer_class = PersonSerializer
  
      def get_queryset():
          invalid_entries = Person.objects.filter(wealth=None)
          valid_entries = Person.objects.all().difference(invalid_entries).order_by('-wealth')
          return valid_entries.union(invalid_entries)
  </code></pre>
  
  <p>This does return the desired behavior, <code>(Abby, Carl, Ben, Diane)</code> but messes up the detail view, and gives the <code>get() returned multiple values</code> error.</p>
  
  <hr>
  
  <p>Is there a way to get the desired behavior, by customizing the ordering functionality, or modifying <code>get_queryset</code> <em>only</em> for the list view?</p>