Django: Why when using auto-populate from a manytomany or foreignkey field I always get the ID?
I have a slug field that I would like to be auto-populated from a value in a many开发者_运维问答tomany. It kind of works as it displays in realtime the ID of the selection in the manytomany field. The model of the manytomany field has its own def unicode(self) to return a string value with its name but this doesnt appear in the slug.
Django's populate javascript always just uses the value attribute of the coresponding HTML field, which is always the id, it it is a select, no matter how you change your python code! You will need to make a custom js to achieve what you are trying to do!
精彩评论