jazzband / django-admin2

Extendable, adaptable rewrite of django.contrib.admin
BSD 3-Clause "New" or "Revised" License
1.18k stars 152 forks source link

Support for alphanumeric PKs #380

Open brente opened 10 years ago

brente commented 10 years ago

The default admin url patterns (in djadmin2.types) expect the model's PK to be strictly numeric. This is not always the case, and I think there should be an easier (and DRY) way to implement this.

Django's admin uses a generic pattern (r'^(.+)/$'), but I like the idea of restricting it for numeric PKs (faster 404s, etc.).

Whatever the final decision, the default pattern should be documented, especially if it differs from Django's standard.

How to implement support for the non-default pattern is a design choice:

I don't like magic, but that would allow developers to add a model to the admin without necessarily defining a ModelAdmin. This means that the best solution is probably the fourth ("...") :-)

I'm sorry if this has already or is being discussed elsewhere. I'd love to contribute to the solution, but I just started looking into django-admin2 and I'm not ready to suggest one yet.

Stefano

auvipy commented 7 years ago

Hi, sorry that no one responded. please join us https://gitter.im/jazzband/django-admin2 for further discussions.