carltongibson / neapolitan

Quick CRUD views for Django
https://noumenal.es/neapolitan/
MIT License
413 stars 30 forks source link

Add ability to change base html template #21

Closed kasun closed 1 year ago

kasun commented 1 year ago

It is not ideal that Neapolitan expects the base html template of the CRUD pages should to named base.html. This PR adds support to change the base html that Neapolitan looks for through settings.

NEAPOLITAN = {
    "SETTING_NAME": "setting_value",
}

I think this is what meant in step 2 of #6. In any case imo this is a must have functionality going forward.

carltongibson commented 1 year ago

Hi @kasun — thanks for this. Yes, it's Ref #6.

There's too much going on too quickly here. If we're going to add settings, we'll do that slowly, and not likely via a utils module.

First pass would be to add a class level attribute, that can be overridden (or provided via in initkwarg to as_view()) -- That might not be the final resting place, but it's a vital waypoint: Folks will want to change this per-view.

That will need a test case showing that it can be overridden. (As well as docs in the CRUDView reference.)

Are you up for trimming this back to that as a first step?

Thanks. 🎁

kasun commented 1 year ago

Yes sounds good. Can you let me know how to run the tests?

kasun commented 1 year ago

I think i got it.

django-admin test --settings=tests.settings --pythonpath=.

kasun commented 1 year ago

Closing this in favor of #24