Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Associate Field Names to Card Type #32

Open
ImplyingICheck opened this issue Jul 3, 2023 · 0 comments
Open

Associate Field Names to Card Type #32

ImplyingICheck opened this issue Jul 3, 2023 · 0 comments

Comments

@ImplyingICheck
Copy link
Owner

Currently, field names are created and assigned to each card individually. This is inefficient and does not reflect how Anki handles cards itself. Instead, field names should be generated once and then associated with that specific card type.

The information should be stored at the AnkiDeck scope. Though the same card may be read into multiple AnkiDecks, we should treat each as independent entries rather than references to the same entry.

This also requires refactoring how AnkiCards store information internally. Currently, the field name is used to access the value stored in that field. One idea for a replacement is to store the unique field names as an ordered dict mapping {field_name: index} where index is the location of the field value corresponding to field_name.

An issue to keep in mind is intended behaviour when card types are not explictly listed.

[ankideckconstructor] src/gaggle/gaggle.py (Line 807)


def _generate_unique_field_names(field_names: Iterator[str] | Iterable[str],

Open in IDE · Open on GitHub

Created from JetBrains using CodeStream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant