render a CharField as checkbox in Django admin?
Is it possible to render a Django model CharField as a checkbox? I need t开发者_如何学运维his checkbox on admin edit page as well as the list_editable
list page. E.g. when checked, set this CharField value to 't'
, else set it to 'n'
You can do a form changing the widgets no matter the type you are using. Here is the documentation
Then if you need to change other things depending on the input people gives I guess you should do some jQuery creating a $('#mycheckboxid').click function
精彩评论