code: def serialize(self, obj, fields=None, exclude=None, **options):
          
          options = _merge({}, self.options, options)
  
          # Handle model instances
          if isinstance(obj, models.Model):
              fields = parse_selectors(obj.__class__, fields, exclude, **options)
              return model_to_dict(obj, fields=fields, **options)
  
          # Handle querysets
          if isinstance(obj, QuerySet):
              fields = parse_selectors(obj.model, fields, exclude, **options)
              return queryset_to_list(obj, fields=fields, **options)
  
          # Handle dict instances
          if isinstance(obj, dict):
              exclude = exclude or []
              if not fields:
                  fields = iter(obj.keys())
              fields = [x for x in fields if x not in exclude]
              return model_to_dict(obj, fields=fields, **options)
  
          # Handle other iterables
          if hasattr(obj, '__iter__'):
              return [self.serialize(x, fields, exclude, **options) for x in obj]
  
          return obj
docs: Recursively attempts to find ``Model`` and ``QuerySet`` instances
          to convert them into their representative datastructure per their
          ``Resource`` (if one exists).