Reputation: 1
In the Django admin, I can set a slug field to fill in automatically using prepopulated_fields. How can I set a field to fill in using a different function, for example just basic concatenation instead of lowercase and spaces-to-hyphens ?
Upvotes: 0
Views: 387
Reputation: 118458
There is no out of the box support for this (assuming you're talking replacing the exact, live editing that preopulated_fields provides).
The slug function is written in JavaScript, in django/contrib/admin/media/js/urlify.js
You could potentially insert a new script in the ModelAdmin
extra JS property, but make sure your admin page doesn't actually need the "real" slugify script :)
Upvotes: 1