本文整理汇总了Python中muddery.utils.localiztion_handler.localize_form_fields函数的典型用法代码示例。如果您正苦于以下问题:Python localize_form_fields函数的具体用法?Python localize_form_fields怎么用?Python localize_form_fields使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了localize_form_fields函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, *args, **kwargs):
super(ConditionDescForm, self).__init__(*args, **kwargs)
choices = get_all_objects()
self.fields['key'] = forms.ChoiceField(choices=choices)
localize_form_fields(self)
开发者ID:muddery,项目名称:muddery,代码行数:7,代码来源:default_forms.py
示例2: __init__
def __init__(self, *args, **kwargs):
super(WorldNPCsForm, self).__init__(*args, **kwargs)
# NPC's typeclass
objects = DATA_SETS.typeclasses.objects.filter(category="CATE_CHARACTER")
choices = [(obj.key, obj.name + " (" + obj.key + ")") for obj in objects]
self.fields['typeclass'] = forms.ChoiceField(choices=choices)
# NPC's location
objects = DATA_SETS.world_rooms.objects.all()
choices = [(obj.key, obj.name + " (" + obj.key + ")") for obj in objects]
self.fields['location'] = forms.ChoiceField(choices=choices)
# NPC's model
choices = [("", "---------")]
objects = DATA_SETS.character_models.objects.all()
model_keys = set([obj.key for obj in objects])
choices.extend([(model_key, model_key) for model_key in model_keys])
self.fields['model'] = forms.ChoiceField(choices=choices, required=False)
# NPC's icon
choices = [("", "---------")]
objects = DATA_SETS.icon_resources.objects.all()
choices.extend([(obj.key, obj.name + " (" + obj.key + ")") for obj in objects])
self.fields['icon'] = forms.ChoiceField(choices=choices, required=False)
localize_form_fields(self)
开发者ID:kickreg,项目名称:muddery,代码行数:27,代码来源:forms_base.py
注:本文中的muddery.utils.localiztion_handler.localize_form_fields函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论