Hi all,

I'm currently writing unit tests for defer() and only() under issue #18586. 
But there appears to a bug when it comes to chaining the two together.

The docs gives the following example for only():

# Final result loads headline and body immediately (only() replaces any 
existing set of fields).

Entry.objects.defer("body").only("headline", "body")

https://docs.djangoproject.com/en/dev/ref/models/querysets/#defer

It turns out that "body" remains a DeferredAttribute when it shouldn't. So 
in the example above, if the model contained just the two fields "headline" 
and "body" there wouldn't be any deferred field. In my tests "body" is 
still a DeferredAttribute.

Am I getting this right or is this actually a bug?

Cheers,

Will

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ab0e284-5e65-42a5-bd7d-aba7d043a0ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to