Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Added model field name actions #346

Merged
merged 5 commits into from
Aug 19, 2022

Conversation

Aquafina-water-bottle
Copy link
Contributor

@Aquafina-water-bottle Aquafina-water-bottle commented Aug 17, 2022

Use case

I've been working on a script to update a model in place, and I occasionally modify the field names (positioning, etc.) of the model. It would be convenient to use AnkiConnect to do just that.

Additional notes

  • I'm currently working on fleshing out the documentation, hence why this is a draft request. edit: documentation added.
  • Seeing that the multi action exists, I figured that each action only affecting one field is sufficient.
  • I'm personally conflicted on the exact naming of the actions. Perhaps something along the lines of renameFieldName or renameModelFieldName would be better. Do you have any ideas?
  • I was wondering if certain errors should be silent. Currently, the modelFieldAdd action does not show an error if the field already exists, and continues to reposition the field. However, the modelFieldRemove (and the other 2 actions) will show an error if the field does not already exist. Is this behavior good?

Thanks!

@Aquafina-water-bottle Aquafina-water-bottle marked this pull request as ready for review August 17, 2022 18:50
@FooSoft
Copy link
Owner

FooSoft commented Aug 19, 2022

Hey @Aquafina-water-bottle I think this PR looks good. The API surface (for better or worse) has grown organically, and some things are more consistent than others. I think naming and error handling is fine the way you have it now. Thanks for the contribution!

@FooSoft FooSoft merged commit fbd6cca into FooSoft:master Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants