Opened 12 years ago

Closed 7 years ago

#18717 closed Bug (needsinfo)

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

Reported by: German M. Bravo Owned by: nobody
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 Tim Graham)

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 German M. Bravo 12 years ago.

Download all attachments as: .zip

Change History (6)

by German M. Bravo, 12 years ago

comment:1 by Łukasz Rekucki, 11 years ago

Needs tests: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

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.

Version 0, edited 11 years ago by Łukasz Rekucki (next)

comment:2 by Aymeric Augustin, 11 years ago

Component: UncategorizedDatabase layer (models, ORM)
Type: UncategorizedBug

comment:4 by Tim Graham, 9 years ago

Description: modified (diff)

comment:5 by Tim Graham, 8 years ago

@Kronuz, is the issue still relevant (I was thinking 7f51876f99851fdc3fef63aecdfbcffa199c26b9 might have helped)? If so, can you update the patch and add a test? Or at least add some more concrete steps to reproduce to help someone else contribute to the issue?

comment:6 by Claude Paroz, 7 years ago

Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top