FooSoft / anki-connect

Anki plugin to expose a remote API for creating flash cards.
https://foosoft.net/projects/anki-connect/
Other
1.92k stars 218 forks source link

Added various actions relating to model templates #382

Closed Aquafina-water-bottle closed 1 year ago

Aquafina-water-bottle commented 1 year ago

This PR adds a few actions to modify the card template list itself, and should be mostly analogous to the modelField actions. These actions should make it possible to edit a model in place with even more precision than before, and is necessary if we want to do something like add another card template to the model automatically. This use case is exactly what I want to do sometime in the future with my note.

Additionally, this PR makes a minor change to the internal getField function, to reduce a bit of redundant code.

FooSoft commented 1 year ago

Looks good, thanks!