code: def serialize(self, queryset, **options):
          
          self.options = options
  
          self.stream = options.get("stream", StringIO())
          self.selected_fields = options.get("fields")
          self.use_natural_keys = options.get("use_natural_keys", True)
          
          self.xml = options.get("xml", None)
          self.root = (self.xml == None)
          
          self.start_serialization()
          for obj in queryset:
              # hook for having custom serialization
              if hasattr(obj, '__serialize__'):
                  obj.__serialize__(self.xml)
              else:
                  self.serialize_object(obj)
          self.end_serialization()
          return self.getvalue()
docs: Serialize a queryset.
          THE OUTPUT OF THIS SERIALIZER IS NOT MEANT TO BE SERIALIZED BACK
          INTO THE DB.