Anki/anki
Arthur Milchior c14b9e2077 Creating now basic type without doing full sync
There is currently what I believe to be a small bug in anki. You can
clone a note type without doing a full sync, but you can't create
forwardReverse and forwardOptionalReverse note type without doing a
full sync. On the other hand you can clone, and even create any other
basic type without doing a full sync.

This commit simply wants to correct this.

The main trouble is that the method to create a copy of forwardReverse
and forwardOptionalReverse use a copy of the basic model, and add this
copy in the model manager BEFORE adding yet another template. This
commit corrects it by ensuring that the model is added only after all
templates are added, so that anki does not detect any change of a
template in the schema.

In order to do this, I created a method newBasicModel which creates
the basic model without adding it.

By the way, addBasicTypingModel could also use newBasicModel, and then
only change afmt. I didn't do it here because I believe that you want
the change to be minimal, and this correction would not add any
feature, only factorize the code.
2019-10-21 02:30:06 +02:00
..
importing Prevent non-integer ivl when importing from Mnemosyne 2019-08-30 14:56:44 +02:00
template use raw strings for regexs 2019-03-04 17:03:43 +10:00
__init__.py bump version 2019-09-24 16:12:38 +10:00
cards.py update copyright and clarify licenses 2019-02-05 14:01:33 +10:00
collection.py New cards of existing note take due value of NEW siblings 2019-10-19 06:28:10 +02:00
consts.py tidy up unused imports 2019-03-04 17:25:19 +10:00
db.py update copyright and clarify licenses 2019-02-05 14:01:33 +10:00
decks.py put deck fix messages in the collection log 2019-06-27 09:46:56 +10:00
errors.py fix some warnings 2019-03-04 16:01:10 +10:00
exporting.py add option to strip html in export 2019-03-05 08:57:53 +10:00
find.py escape backslash in find&replace 2019-09-24 15:46:26 +10:00
hooks.py update copyright and clarify licenses 2019-02-05 14:01:33 +10:00
lang.py use locales instead of two digit lang codes 2019-09-23 21:18:03 +10:00
latex.py fix some warnings 2019-03-04 16:01:10 +10:00
media.py tidy up unused imports 2019-03-04 17:25:19 +10:00
models.py ensure the list of note types is not empty 2019-04-21 18:02:12 +10:00
mpv.py daemonize helper threads so that sys.exit() during startup works 2019-04-29 14:36:44 +10:00
notes.py update copyright and clarify licenses 2019-02-05 14:01:33 +10:00
sched.py fix some warnings 2019-03-04 16:01:10 +10:00
schedv2.py fix negative due dates in filtered decks 2019-09-24 15:38:33 +10:00
sound.py cleanup recording on cancel 2019-07-14 11:19:29 +10:00
stats.py Allow disabling timeTicks 2019-08-16 01:58:10 +10:00
statsbg.py statsbg credit/link 2019-08-31 10:47:01 +10:00
stdmodels.py Creating now basic type without doing full sync 2019-10-21 02:30:06 +02:00
storage.py tidy up unused imports 2019-03-04 17:25:19 +10:00
sync.py tidy up unused imports 2019-03-04 17:25:19 +10:00
tags.py tidy up unused imports 2019-03-04 17:25:19 +10:00
utils.py keep json in utils for add-on compat 2019-03-06 07:18:26 +10:00