#29532 closed New feature (wontfix)
Make model/app urls configurable for admin
Reported by: | Ramez Issac | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 2.1 |
Severity: | Normal | Keywords: | admin, url, routing |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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
Change History (4)
comment:1 by , 6 years ago
Component: | Uncategorized → contrib.admin |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
comment:2 by , 6 years ago
If you don't like putting as admin specific option in the Meta, (and i tend to agree) then, for this specific use, where you think it should it go ?!
It's not that big of an api change, and maybe there are more and more uses cases that can benefit from this.
A discussion maybe ?
Edit:
From another perspective: permissions
and default_permission
are "kind of" admin related options in the Meta (at least for the majority of cases, they are admin related)
follow-up: 4 comment:3 by , 4 years ago
Zubair Hassan, please don't change tickets descriptions and follow triaging guidelines with regards to wontfix tickets.
comment:4 by , 4 years ago
Thanks felixxm, for pointing out.
I am new to contributions, and just want to add my opinion that, can we use verbose_name
for url generation on admin side for flexibility as on model name and app name?
I don't see this as an 80% use case that justifies adding new APIs, and I don't like the idea of putting admin-specific options in model
Meta
.