本文整理汇总了Python中fields.Field.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Field.__init__方法的具体用法?Python Field.__init__怎么用?Python Field.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fields.Field
的用法示例。
在下文中一共展示了Field.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from fields import Field [as 别名]
# 或者: from fields.Field import __init__ [as 别名]
def __init__(
self,
queryset,
empty_label=u"---------",
cache_choices=False,
required=True,
widget=None,
label=None,
initial=None,
help_text=None,
to_field_name=None,
*args,
**kwargs
):
if required and (initial is not None):
self.empty_label = None
else:
self.empty_label = empty_label
self.cache_choices = cache_choices
# Call Field instead of ChoiceField __init__() because we don't need
# ChoiceField.__init__().
Field.__init__(self, required, widget, label, initial, help_text, *args, **kwargs)
self.queryset = queryset
self.choice_cache = None
self.to_field_name = to_field_name
示例2: __init__
# 需要导入模块: from fields import Field [as 别名]
# 或者: from fields.Field import __init__ [as 别名]
def __init__(self):
Field.__init__(self)
scriptList.register(self)
from kivy.app import App
def inner(*args):
self.stack = App.get_running_app().root.ids['deck'].ids['stack']
from kivy.clock import Clock
Clock.schedule_once(inner,1)
示例3: __init__
# 需要导入模块: from fields import Field [as 别名]
# 或者: from fields.Field import __init__ [as 别名]
def __init__(self, queryset, empty_label=u"---------", cache_choices=False,
required=True, widget=Select, label=None, initial=None, help_text=None):
self.queryset = queryset
self.empty_label = empty_label
self.cache_choices = cache_choices
# Call Field instead of ChoiceField __init__() because we don't need
# ChoiceField.__init__().
Field.__init__(self, required, widget, label, initial, help_text)
self.widget.choices = self.choices