Hi i am trying to save the tag in a databse i am using TinyDb to do that. But i wanna know if this is correct.
By using just day of week, you will be overwriting the existing food with the new value every next week. You can have dictionary to store day key and food value.
See well this is one of the task for my assignment. here ill paste it here if i can.
The app allows a user to record what they had for lunch on a specific day of the week, e.g. on Monday they had Pizza, on Thursday they had Salad.
To keep it simple, we use the days of the week as the tags in the database (think through the implications – can we store what the user had for lunch on more than one
Monday?).
Yes, you can, that's why I have used key-value pair, Monday will be repeated every week, but 21 March comes only once in year, that will provide uniqueness as key.
If you store the weekday as a tag, for example, on January 1 (Monday) the database records the tag as Monday and the food as "French fries". When the user uses the app again on January 8 (also Monday), the database records the tag as Monday and the food as "Chocolate". Now, a database cannot have 2 entries with the same tags, so on January 8, when the user records "Chocolate", it removes the old "French fries" entry and replaces it with the new "Chocolate" entry.
However, if you record the tag as a day of the year, e.g. January 1, you will have to wait for 365-366 days to delete the old entry and replace the new one. If you record the tag as a day of the year and that year, e.g. January 1 2815, you will have to wait infinite years to replace the old entry.
Hey well i am actually trying to store the value tag data which is the food that the user had and when he had it and storing it in tiny db. And then from tinydb i want to retrieve the stored data and have appear in my list view. So i have made this. let me know if it is correct?
And that being said i am wanting to be retrieved with just one of the button but i have not made the blocks of the button just because i dont know how to do that. Could you please help me?
I am really not too sure about using dictionary because in my assignment it doesn't not say that we need to use the dictionary component. But any way i have a question. I have made a math quiz app. And my next button always shows the previous answer of the question. How can i make the answer disappear when the user clicks the next button? Here is my blocks.
Please describe about this app and issue what you are facing in differenct topic, this is not matching with the current topic - Saving the data to TinyDB, isn't it? Thanks
I have tried doing this but when i came and clicked on the save button the application just closed on me