Opened 2 years ago

Last modified 14 months ago

#18717 assigned Bug

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

Reported by: Kronuz Owned by: shaz
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


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 2 years ago.

Download all attachments as: .zip

Change History (4)

Changed 2 years ago by Kronuz

comment:1 Changed 21 months 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 21 months ago by lrekucki (previous) (diff)

comment:2 Changed 16 months ago by aaugustin

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

comment:3 Changed 14 months ago by shaz

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

Add Comment

Modify Ticket

Change Properties
<Author field>
as assigned
The owner will be changed from shaz to anonymous. Next status will be 'assigned'
The ticket will be disowned. Next status will be 'new'
as The resolution will be set. Next status will be 'closed'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.