Add support for SubjectSet metadata as editable attribute #303
+26
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes zooniverse/panoptes-cli#256
The issue: when
SubjectSet.metadata
attribute is edited, there is no check for changes in that field, so it is never added tomodified_attributes
set and therefore those edits were never pushed as a result of thesave()
call.Following same solution as in #222 and #251 for workflow and project attributes:
set_raw
and__init__
functionssave()
to add metadata attribute tomodified_attributes
if contents are differentNote on change in treatment of
SubjectSet.metadata
field: I've changedmetadata
to a standalone key inSubjectSet._edit_attributes
field as opposed to dict similar tolinks
field. The distinction between these two treatments of the attribute occur inPanoptesObject._savable_dict()
(see https://github.com/zooniverse/panoptes-python-client/blob/master/panoptes_client/panoptes.py#L759-L793), but I'm following the precedent already used bySubject
class and elsewhere for these dict attribute fields.Note on CLI issue: although treatment of SubjectSet metadata has been implemented in the CLI for ~2 years (since zooniverse/panoptes-cli#214), it looks like this feature -- identifying and flagging indexed fields by adding them to
indexFields
key in SubjectSet metadata -- has never worked up to this point.This PR currently needs testing: