Closed carltongibson closed 5 months ago
An interactive CLI might be good here.
(By the time folks manually set template_name
, they're on their own.)
Hi @carltongibson, I'm just getting started with this, neapolitian looks delicious! It really lowers the bar to getting a project started. Thanks for all your work creating and documenting it.
A couple of questions, to get me started:
Hey @tom-moran. That sounds like what I have in mind yes. 😊
The point about which models have a CRUDView
registered would be to restrict the options to a sensible set.
Happy to input if you need.
Thanks for looking at this!
Hey, what's the progress on this? I was hoping to work on it
@earthcomfy Please do. (This ticket crossed my mind again just the other day.)
Hi, sorry I dropped this one, i didn't manage to make time for it. Hope to make some space to pick up other issues.
I've pushed a first prototype for a mktemplate
command in this branch here:
https://github.com/carltongibson/neapolitan/compare/add-mktemplate-command
It needs tests, docs, and a couple of edge-cases refined, but it's the basic idea.
% ./manage.py mktemplate my_app.MyModel --list
If someone would like to use that as the basis of a PR, that would be awesome. (Check out that branch and work against that; we can merge to main
once it's worked out.)
Added a basic test case.
OK, I added some docs as well. And a change note.
Don't know if anyone wants to look at the TODO in the code, otherwise I might leave it for whoever first hits the issue. (Since it works for me the way I do it already 😅)
OK, this made it into the 24.2 release. https://noumenal.es/posts/neapolitan-242-released/DkK/
The default templates are good to get started, but then you find you need to customise.
The process here is to copy the (for example)
object_list.html
template as (for example)bookmark_list.html
and then start making your changes.A management command that found the neapolitan default (using the template loader, so allowing overrides) and then created the per-model version from that would be a nice addition.