How can I create with many Fields?
See original GitHub issueHello first of all thank you with this python library. It is so cool! really helps me a lot in creating anki decks!
I have a question thoooo can you please help me and I think my question is just very very simple so here it is
my_note = genanki.Note(
model=my_model,
fields=['Capital of Argentina', 'Buenos Aires'])
On this code is you create a card right with the question “Capital of Argentina” and as the answer “Buenos Aires”… and it looks like this
I was thinking of can you provide an example on how can I make a field like this?
Thank you so much!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to create an object for a Django model with a many to ...
You can do this without specifying a "through" model on the field. For completeness, the example below creates a blank Users model to...
Read more >Many-to-many relationships - Django documentation
To define a many-to-many relationship, use ManyToManyField . In this example, an Article can be published in multiple Publication objects, and a Publication ......
Read more >The right way to use a ManyToManyField in Django
To maintain a many-to-many relationship between two tables in a database, the only way is to have a third table which has references...
Read more >Create Many-to-Many Relationships - Intermediate Django
Link Users With Many-to-Many Fields · Step 1: Update the Models · Step 2: Creating Many-to-Many Relationships in a Form · Step 3:...
Read more >Tips for Using Django's ManyToManyField - REVSYS
The invisible "through" model that Django uses to make many-to-many relationships work requires the primary keys for the source model and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the help on this, @remiberthoz !
I think one thing to help make this issue clearer is we could throw an exception when the number of
fields
in aNote
doesn’t match the number offields
in theModel
. @gelodefaultbrain would that have helped you understand this problem and fix it on your own?Hey! I’m not the author or genanki but I can help on this one. When creating a note, you can pass as many fields as you wish:
but this only makes sense if the model (
my_model
) you create defines the correct amount of fields:So in you case you would have to define quite a lot of such fields when creating the model, and pass the list of values when creating notes.