Keep model of add cards

AnkiWeb addon 424778276

Keeps the note type in Anki’s add window unchanged except when selected there, preventing unintended changes from imports or note-type edits elsewhere.
AI-generated summary; may contain mistakes.

card-templatesbugfix-workaround

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
13 (👍 11 · 👎 2)
Updated
2021-10-16
Anki versions
2.1.48~
Description language
en

Maintenance

abandoned

  • Last update or commit was 1811 days before the snapshot (2021-10-16).

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.02.1.232019-03-22
2.1.242.1.472020-05-16
2.1.48+2021-10-16
History across monthly snapshots

Loading…

Similar addons

Merge Notes

Merge multiple selected notes into one new note with field mapping, separators, cloze removal, tag preservation, optional original deletion, history transfer, undo, and logs.

schedulingnote-managementformattingcard-templates

Rating 0 👍 0 · 👎 0 ⭐ 2 Anki 2.1.1~ Updated 2026-06-06
Free Weekend - or AOD (Legacy)

Reschedules new reviews away from selected weekdays or specific dates using Anki's fuzz range, while leaving learning and past schedules unchanged.

schedulingobsolete

Rating 54 👍 46 · 👎 8 ⭐ 8 Anki <=2.1.35 Updated 2022-05-23

README

Keep model of add cards

Rationale

For some reason, the note type in anki «add» window may suddenly change. In the worst case, it may lead to losing data, if the new note type has less fields than the old note type. It may also means you'll submit the note in the wrong type if you didn't pay attention.

More precisely, this may occur in the following cases:

  • In the browser, if you change the note type of a note already existing.
  • If you use the importing window and change the note type.
  • Using addon Open multiple instances of the same window, when you change the note type of a «add» window.

Usage

This add-on ensure that the note type of a «add» window only change when you choose a note type from the same window.

Internal

  • In module aqt.addcards, AddCards is replaced by a class. The new class inherits from the older one. It redefines __init__ and _reject, by calling the previous method, and changing its hooks. It redefines setupChoosers, onReset, _addCards, by copy-pasting the previous code and doing some modification. Thus, it may be incompatible with other add-ons also editing those notes. Finally it creates a method onResetSameModel.
  • Hooks currentModelChanged does not change anything in the "add" window. "reset" still call the method "onReset", but a version which does not change the model.
  • The ModelChooser of the "add" window is a new class, inheriting from aqt.modelchooser.ModelChooser. It redefines __init__, calling the previous method and removing some hook. It redefine onModelChange by copy-paste the old code, removing everything affecting the environment, and affecting directly the current "add" window.

Links, licence and credits

Key Value
Copyright Arthur Milchior arthur@milchior.fr
Based on Anki code by Damien Elmes anki@ichi2.net
License GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
Source in https://github.com/Arthur-Milchior/anki-keep-model-in-add-cards
Addon number 424778276