Generate the correct queryset when serializing to_model id (e.g. project_id).