Opened 4 years ago

Last modified 4 weeks ago

#18717 new Bug

Setting attributes on deferred objects should trigger field's descriptor's __set__()

Reported by: Kronuz Owned by:
Component: Database layer (models, ORM) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by timgraham)

Setting attributes on deferred objects (DeferredAttribute) should trigger original field's descriptor's __set__() (if any).
Currently, specially for custom fields set up as descriptors defining __set__(), the original field's __set__ is never called when setting object attributes on deferred fields.

Attachments (1)

#18717-deferred_fields_and_descriptors.diff (864 bytes) - added by Kronuz 4 years ago.

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by Kronuz

comment:1 Changed 4 years ago by lrekucki

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

The patch failes as DeferredAttribute no longer has model_ref. On a side note, _meta.get_field_by_name can be used instead of iterating.

Last edited 4 years ago by lrekucki (previous) (diff)

comment:2 Changed 3 years ago by aaugustin

  • Component changed from Uncategorized to Database layer (models, ORM)
  • Type changed from Uncategorized to Bug

comment:3 Changed 3 years ago by shaz

  • Owner changed from nobody to shaz
  • Status changed from new to assigned

comment:4 Changed 9 months ago by timgraham

  • Description modified (diff)

comment:5 Changed 4 weeks ago by timgraham

  • Owner shaz deleted
  • Status changed from assigned to new
Note: See TracTickets for help on using tickets.
Back to Top