carltongibson / neapolitan

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

URL format of views #27

Closed kasun closed 1 year ago

kasun commented 1 year ago

In RESTful convention we name a resource's URL prefix in plural form. It would be nice to do the same for the CRUD views. So for example listing URLs will be /projects not /project

If you have no objection can submit a PR for this.

carltongibson commented 1 year ago

Hi @kasun — I think this is probably part of #11. Would you fancy looking at that?

kasun commented 1 year ago

Hi, I had a look but fail to understand the relationship between the two.

My question is whether we should pluralize the verbose_name here https://github.com/carltongibson/neapolitan/blob/main/src/neapolitan/views.py#L449

carltongibson commented 1 year ago

Yes, I understand. 🙂 My point is that that whole URL generation needs to be configurable.

kasun commented 1 year ago

Oh right thanks. Are you ok with multiple features been in a single PR related to URL generation?

  1. Handling pk
  2. pluralizing verbose name
  3. Ability to define a custom verbose name
carltongibson commented 1 year ago
  1. pluralizing verbose name

I'm not 100% convinced about this, but making that configurable is part of the get_urls() work.

Let's close this in favour of #11