I've done a to do list flask app that also has room for documenting what the project is about and what I've learnt while working on it. Currently everything works fine except I can't seem to figure out how to add a button where I can edit my project documentation and chatgpt is just confusing me. Could someone tell me if there's like a specific function in flask for editing an entry?? I don't think I should share the code here since it's quite long but if you want to see it I will add it.
#π How to update an sqlalchemy database?
17 messages Β· Page 1 of 1 (latest)
@shrewd cairn
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
we can't really help you without seeing the code, if it's long you should post it to our own pastebin-like service and then paste the link to it here
!paste
Pasting large amounts of code
So that everyone can easily read your code, you can paste it in this website:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
also, it's quite unclear what you even mean, i think you need to describe it a bit better
https://paste.pythondiscord.com/N7LQ
ok here it is
not related to your question, but i suggest that your move the secrets and configuration from your codebase and instead use something like a .env file using the python-dotenv module (which needs to be installed separately)
i don't understand what you mean with adding a button where you can edit your project documentation
where do you want this project documentation to be shown?
i just want to know how to edit something that's already in the database
oh, now i understand, you meant updating the project description (project_desc) for an item in your "To Do list" that is stored in the database
or did you want to update the project name?
yeah, project_desc
you will need to create a new route that takes an id (just like you are already doing with the delete and the taskdetail endpoints) and get the data for that entry and then update that field and then update the database by committing that change to the database
ok. I'm going to try and do it on my own. i'll let you know how it goes. no need to wait for it though since i'm working on some other tasks now. thanks for your help
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.