#29532: Make app/model urls configurable for admin
-------------------------------------+-------------------------------------
Reporter: Ramez Issac | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin , url, | Triage Stage:
routing | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Zubair Hassan):
* status: closed => new
* cc: Zubair Hassan (added)
* version: 2.1 => master
* resolution: wontfix =>
Old description:
> If i rely heavily on admin, i would want to configure the urls text
> regarding to the app / model.
> My reasons
> 1- it's not always i want the url to say the "technical" model name, and
> maybe i just want it to be short "user friendly" name
> (and i don't want to make a proxy model just for that, and that would
> only solve the <model_name> part of the url)
>
> 2- This task is kinda long if one wants to customize one or two model
> name urls.
> One would have to override the `get_urls` and maybe find out that they
> may want to override the `register` itself.
>
> My Proposal:
> I believe it can be controlled by an
> - AppConfig option (say `admin_app_name`) for apps, and ,
> - Model Meta option for the models (say `admin_model_name`),
> Those options will be accessible from model _meta , and we would use
> those options instead of the current `app_label` & `model_name` to
> construct the admin urls.
> And so the final url would look something like this
> `admin/<admin_app_name>/<admin_model_name>/add|change|delete`
New description:
If i rely heavily on admin, i would want to configure the urls text
regarding to the app / model.
My reasons
1- it's not always i want the url to say the "technical" model name, i
just want it to be short or "user friendly" name like verbose_name of
model and app properties.
My Proposal:
I believe it can be controlled by verbose_name which is already exist on
model as well as on appConfig.
We just have to only check if verbose_name exist for model or app
otherwise default model name or app label should consider for url.
Where as the matter of spaces in verbose_name it could be replaced by
`'-'`.
think a model name is `UserCreditCardData` and we just want to show as
User Personal Data we can do this using verbose_name but what about admin
url?
it could be `admin/app-label/user-personal-data/` as compare to `admin
/app-label/usercreditcarddata/` same is the case could be for `app_label`.
And so the final url would look something like this
`admin/<app_label | verbose_name>/<model_name |
verbose_name>/add|change|delete`
Here verbose_name precede if exist on app or model.
I already implemented it for my app if it is acceptable i could do this.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29532#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.ed6f860e6df23ee65c28260556940b17%40djangoproject.com.