當前位置: 首頁>>代碼示例>>Python>>正文


Python utils.unset_value方法代碼示例

本文整理匯總了Python中wtforms.utils.unset_value方法的典型用法代碼示例。如果您正苦於以下問題:Python utils.unset_value方法的具體用法?Python utils.unset_value怎麽用?Python utils.unset_value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wtforms.utils的用法示例。


在下文中一共展示了utils.unset_value方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from wtforms import utils [as 別名]
# 或者: from wtforms.utils import unset_value [as 別名]
def __init__(self, label=None, validators=None, places=unset_value, rounding=None, **kwargs):
        super(DecimalField, self).__init__(label, validators, **kwargs)
        if self.use_locale and (places is not unset_value or rounding is not None):
            raise TypeError("When using locale-aware numbers, 'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding 
開發者ID:snverse,項目名稱:Sci-Finder,代碼行數:11,代碼來源:core.py

示例2: process

# 需要導入模塊: from wtforms import utils [as 別名]
# 或者: from wtforms.utils import unset_value [as 別名]
def process(self, formdata, data=unset_value):
        if data is unset_value:
            try:
                data = self.default()
            except TypeError:
                data = self.default
            self._obj = data

        self.object_data = data

        prefix = self.name + self.separator
        if isinstance(data, dict):
            self.form = self.form_class(formdata=formdata, prefix=prefix, **data)
        else:
            self.form = self.form_class(formdata=formdata, obj=data, prefix=prefix) 
開發者ID:snverse,項目名稱:Sci-Finder,代碼行數:17,代碼來源:core.py

示例3: _add_entry

# 需要導入模塊: from wtforms import utils [as 別名]
# 或者: from wtforms.utils import unset_value [as 別名]
def _add_entry(self, formdata=None, data=unset_value, index=None):
        assert not self.max_entries or len(self.entries) < self.max_entries, \
            'You cannot have more than max_entries entries in this FieldList'
        if index is None:
            index = self.last_index + 1
        self.last_index = index
        name = '%s-%d' % (self.short_name, index)
        id = '%s-%d' % (self.id, index)
        field = self.unbound_field.bind(form=None, name=name, prefix=self._prefix, id=id, _meta=self.meta,
                                        translations=self._translations)
        field.process(formdata, data)
        self.entries.append(field)
        return field 
開發者ID:snverse,項目名稱:Sci-Finder,代碼行數:15,代碼來源:core.py

示例4: _add_entry

# 需要導入模塊: from wtforms import utils [as 別名]
# 或者: from wtforms.utils import unset_value [as 別名]
def _add_entry(self, formdata=None, data=unset_value, index=None):
        assert not self.max_entries or len(self.entries) < self.max_entries, \
            'You cannot have more than max_entries entries in this FieldList'
        if index is None:
            index = self.last_index + 1
        self.last_index = index
        name = '%s-%d' % (self.short_name, index)
        id = '%s-%d' % (self.id, index)
        field = self.unbound_field.bind(form=None, name=name, prefix=self._prefix, id=id, _meta=self.meta)
        field.process(formdata, data)
        self.entries.append(field)
        return field 
開發者ID:sunqb,項目名稱:oa_qian,代碼行數:14,代碼來源:core.py

示例5: process

# 需要導入模塊: from wtforms import utils [as 別名]
# 或者: from wtforms.utils import unset_value [as 別名]
def process(self, formdata, data=unset_value):
        super(DestinationField, self).process(formdata, data)
        if self.destination_label is not None:
            self.form.type.label.text = self.destination_label 
開發者ID:wazo-pbx,項目名稱:wazo-admin-ui,代碼行數:6,代碼來源:destination.py


注:本文中的wtforms.utils.unset_value方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。