Anki/anki
Arthur Milchior b78480fe52 New model can be edited without full sync
This commit solves a problem that I had many time in the past. When I
create a new model, I usually want to edit it. Clone of existing
models present no interest by themselves. And as soon as I edit it, I
need to do a full sync.

As far as I understand ankiweb (which is sadly closed source), the
full sync is required because ankiweb needs to know that the model
associated to note type on the server did change. But since the model
is new, it has no note type associated to on the server, so there is
no need to do a full sync immediatly. Since the model is new, it also
means there is no risk of the inconsistency with a change made in
another computer/smartphone.

Thus, when a field/template is added, I check that the model is not
new by checking both whether it's id is not null, and also that it's
usn is not -1. (I set usn early in the model's life)

If it does not make into anki, then it'll be an add-on. But it's worth
a try first.
2019-10-24 04:44:52 +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 New model can be edited without full sync 2019-10-24 04:44:52 +02: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 Factorize standard models to use other models 2019-10-22 02:43:20 +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