Changes between Initial Version and Version 5 of Ticket #24689


Ignore:
Timestamp:
Apr 23, 2015, 10:15:49 AM (9 years ago)
Author:
Bertrand Bordage
Comment:

Indeed, it’s not occurring using ListView. I assumed it would occur on it because I thought User.objects.defer('password') would be a queryset of the proxy model User_Deferred_password, but it’s not. It’s only once you get model instances that they use the proxy model.

Sorry for not checking :(

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24689

    • Property Summary DetailView & ListView get_template_name fails with deferred QuerySetDetailView get_template_name and get_context_object_name fail with deferred QuerySet
    • Property Easy pickings unset
    • Property Triage Stage UnreviewedAccepted
    • Property Has patch set
    • Property Needs tests set
  • Ticket #24689 – Description

    initial v5  
    1414This is because Django creates a proxy model each time you use defer/only. And therefore {{{User.objects.defer('password')[0]._meta.model_name}}} is {{{'user_deferred_password'}}}.
    1515
    16 {{{(DetailView|ListView).get_template_name}}} should ckeck if {{{model._deferred}}} and use {{{model._meta.proxy_for_model}}} to get the original model.
     16{{{DetailView.get_template_name}}} should ckeck if {{{model._deferred}}} and use {{{model._meta.proxy_for_model}}} to get the original model.
Back to Top