Skip to content

Checking required fields doesn't work properly #21

@Heliozoa

Description

@Heliozoa

Hi,
Thanks for your work on genanki-rs.

I noticed in my project that with the following qfmt

<div id=sentence>
    {{furigana:sentence}}
</div>

the Model::req function determines that all of the fields of the model

(

        vec![
            Field::new("id"),
            Field::new("count"),
            Field::new("word_id"),
            Field::new("sentence_id"),
            Field::new("sentence"),
            Field::new("word"),
            Field::new("translation"),
            Field::new("kanji"),
            Field::new("generated_at"),
        ]

)

are required, which is not the case. It will then skip creating cards for any note where any field is empty. I don't really understand the intended logic of req so I'm not sure where the issue is exactly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions