rbac08 图标样式

我只是一个虾纸丫 提交于 2019-12-01 09:10:15

  

 

from django import forms
from rbac import  models
from django.utils.safestring import mark_safe ############safe#################3
class MenuModuleForm(forms.ModelForm):
    class Meta:
        model = models.Menu
        fields="__all__"
        error_messages={
          'title': {
              'required': "该字段不能为空!"
                    },
            'icon':{
                'required':"必须选择图标!"
            }
        }
        widgets={
            'title':forms.TextInput(attrs={'class':'form-control'}),
            'icon':forms.RadioSelect(choices=[ #######RadioSelect   ==》 列表套列表
                ['fa-address-book-o',mark_safe('<i class="fa fa-address-book-o" aria-hidden="true"></i>')],#########标记安全
                ['fa-id-card-o',mark_safe('<i class="fa fa-id-card-o" aria-hidden="true"></i>')],
                ['fa-free-code-camp',mark_safe('<i class="fa fa-free-code-camp" aria-hidden="true"></i>')],
                ['fa-etsy fa-6',mark_safe('<i class="fa fa-etsy fa-6" aria-hidden="true"></i>')],
                ['fa-battery-2',mark_safe('<i class="fa fa-battery-2" aria-hidden="true"></i>')],
                ['fa-automobile',mark_safe('<i class="fa fa-automobile" aria-hidden="true"></i>')],

                                              ])
        }

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!