Closed anschelburk closed 3 months ago
Awesome progress. let's walk through this in ~2 hours ...
Re admin, the decorator code is here: venv/lib/python3.1x/site-packages/django/contrib/admin/decorators.py
(I have a shortcut in Vim that lets me jump to source code rapidly)
The first part of this update is really interesting, getting code provided by another dev working is a super valuable and needed skill ("not uncommon" -> "very common" I think actually)
Would you like to blog post about this after PDM? You can do so on our blog ... (I can think of at least 5 other cool posts you could do haha, up to you though ...)
2 small fixes on https://github.com/anschelburk/simpleplanner/pull/19/files + starter steps for multi widget feature which I logged here: https://github.com/anschelburk/simpleplanner/issues/20
If you want to work from my changes merge them into this branch, then merge it into main and start a new branch please.
Summary & Update
Thank you for your comment - I have now implemented the changes into this branch. This ended up being an unexpectedly interesting exercise: I was given a link to a separate GitHub repo which was similar enough to integrate a lot of the code, but different enough that I had to first go through everything, learn the names of the variables and models you used (most of which were different from mine), change the code so it was compatible with my repo, and then integrate the relevant parts of it in.
This started out very slow for me: I spent a lot of time looking up individual lines and sections of code, and spent a significant amount of time at the end of Day 1 / beginning of Day 2 figuring out how I could effectively organize and document my work (for myself) so that I wouldn't lose track of anything. (I kept in mind that, recently, you found that a piece of my code had failed simply because of four minor typos. I realized that in order to avoid that here, I needed to have a good enough organizational system to keep track of what I was doing - especially in Django, where many of the modules import each other, and depend on each other to work.)
In the end, I came out with what seems like a much better system for organizing my code within my IDE and getting things done. (I'll show you tomorrow - an unexpected bonus was that my system was good enough that I was able to completely debug my own code - in under 15 minutes!) I imagine that this kind of exercise - looking at a repo someone else created to help with a current project - is probably not uncommon in software roles, and it was really cool to get some experience successfully going through that process here.
Questions
A few questions I'd like to go over tomorrow:
@admin_register
tag. Forgive me if we talked about this before, but I'm realizing that I'm a little unclear about what it does, and why we need it when we already have anadmin.py
module.forms.py
module does. I think we may have talked about this toward the beginning of theMath Homework
app, but I think it would be helpful (for me) to go over it again, now that I've spent some time learning more about HTML forms, URL endpoints, and HTMX.item.html
does in the code you sent. (In my code, I renamed it tolist_item.html
.) It would be helpful for me if we could talk about this.pk
does. In the code you sent, it's inviews.update_item
(in my code, I named itviews.list_update_item
). From the URLConfig you sent, my guess is that it represents the ID of a list item, but would love to talk more about whether that's right (and if it is, how it works with the rest of the code - how is it created, for instance?)Next Steps
A few next steps that I think would be good:
list/
URLConfig has an editing feature - I was only able to see anAdd
button.base_site.html
page to include multiple frames, each one loading a distinct HTML template. However, if you think there's a better way, please let me know!Looking forward to checking in tomorrow morning!
-AKB