-
Notifications
You must be signed in to change notification settings - Fork 22
feat: Set {field}_URL to Deleted for attachments marked as deleted
#335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
is_deleted field and set url to Deleted for deleted attachments{field}_is_deleted column and set {field}_URL to Deleted for deleted attachments
src/formpack/schema/fields.py
Outdated
| class MediaField(TextField): | ||
| def get_labels(self, include_media_url=False, *args, **kwargs): | ||
| label = self._get_label(*args, **kwargs) | ||
| labels = [label, f'{label}_is_deleted'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, requirements say:
Set URL cell to ‘Deleted’ - Only if “Include media URLS” is checked
So no need to add another field. Just replace the attachment URL with "Deleted"
src/formpack/schema/fields.py
Outdated
| ): | ||
| if val is None: | ||
| val = '' | ||
| first_attachment = attachment[0] if attachment else {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first_attachment is misleading IMO. I was thinking about other attachments in the same list.
What about using attachment again? attachment = attachment[0] ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right! I've updated it accordingly
0bca3fa to
7f6e8e4
Compare
{field}_is_deleted column and set {field}_URL to Deleted for deleted attachments{field}_URL to Deleted for attachments marked as deleted
noliveleger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ts TASK-575 (#5819) ### 📣 Summary Ensure KPI installs the latest formpack version to support new export features for deleted media attachments. ### 📖 Description This PR updates the formpack dependency hash in `requirements.in`, `requirements.txt`, and `dev_requirements.txt` to use the commit from [formpack#335](kobotoolbox/formpack#335). That PR introduces support for displaying deleted attachments more clearly in exports: - Replaces `{field}_URL` with the text `Deleted` when the attachment is marked as deleted and `include_media_url=True`. These changes ensure that exports generated by KPI reflect deleted attachments more transparently for end users.
Summary
Set
{field}_URLto 'Deleted' for deleted attachments, wheninclude_media_urlis True.Description
{field}_URLto 'Deleted' if the attachment is marked as deleted andinclude_media_urlis True.{field}_URLfield.