本文整理汇总了Python中django.db.models.CharField.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python CharField.__init__方法的具体用法?Python CharField.__init__怎么用?Python CharField.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.db.models.CharField
的用法示例。
在下文中一共展示了CharField.__init__方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, *args, **kwargs):
kwargs.setdefault('editable', True)
kwargs.setdefault('verbose_name', _('Initials'))
kwargs.setdefault('max_length', 3)
kwargs.setdefault(
'help_text', _('Type 2-3 letters, all in uppercase and no spaces'))
CharField.__init__(self, *args, **kwargs)
示例2: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, *args, **kwargs):
kwargs.setdefault('editable', False)
kwargs.setdefault('blank', True)
kwargs.setdefault('max_length', 50)
kwargs.setdefault('verbose_name', 'Hostname')
kwargs.setdefault('default', socket.gethostname())
CharField.__init__(self, *args, **kwargs)
示例3: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, *args, **kwargs):
kwargs.setdefault('verbose_name', _('What type of identity number is this?'))
kwargs.setdefault('editable', True)
kwargs.setdefault('max_length', 15)
kwargs.setdefault('choices', IDENTITY_TYPE)
# kwargs.setdefault('help_text', _('Format is 9999[12]9999'))
CharField.__init__(self, *args, **kwargs)
示例4: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, based_fields=None, zoom=None, suffix='',
max_length=63, *args, **kwargs):
super(PlainLocationField, self).__init__(based_fields=based_fields,
zoom=zoom, suffix=suffix, *args, **kwargs)
CharField.__init__(self, max_length=max_length, *args, **kwargs)
示例5: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, *args, **kwargs):
kwargs.setdefault('editable', False)
kwargs.setdefault('blank', True)
kwargs.setdefault('null', True)
kwargs.setdefault('max_length', 150)
kwargs.setdefault('verbose_name', 'Revision')
CharField.__init__(self, *args, **kwargs)
示例6: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, max_length=63, *args, **kwargs):
super(PlainLocationField, self).__init__(*args, **kwargs)
kwargs.pop('based_fields', None)
kwargs.pop('zoom', None)
kwargs.pop('suffix', None)
CharField.__init__(self, max_length=max_length, *args, **kwargs)
示例7: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, *args, **kwargs):
kwargs['max_length'] = kwargs.get('max_length', 32 )
try:
self.auto = kwargs['auto']
del kwargs['auto']
except KeyError:
self.auto = True
CharField.__init__(self, *args, **kwargs)
示例8: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, verbose_name=None, name=None, auto=True, version=1, node=None, clock_seq=None, namespace=None, **kwargs):
kwargs['max_length'] = 36
if auto:
kwargs['blank'] = True
kwargs.setdefault('editable', False)
self.version = version
if version==1:
self.node, self.clock_seq = node, clock_seq
elif version==3 or version==5:
self.namespace, self.name = namespace, name
CharField.__init__(self, verbose_name, name, **kwargs)
示例9: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, verbose_name=None, name=None, auto=True, version=4, node=None, clock_seq=None, namespace=None, **kwargs):
if not HAS_UUID:
raise ImproperlyConfigured("'uuid' module is required for UUIDField. (Do you have Python 2.5 or higher installed ?)")
kwargs.setdefault('max_length', 36)
if auto:
self.empty_strings_allowed = False
kwargs['blank'] = True
kwargs.setdefault('editable', False)
self.auto = auto
self.version = version
if version == 1:
self.node, self.clock_seq = node, clock_seq
elif version == 3 or version == 5:
self.namespace, self.name = namespace, name
CharField.__init__(self, verbose_name, name, **kwargs)
示例10: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, verbose_name=None, name=None, **kwargs):
kwargs['max_length'] = kwargs.get('max_length', 200)
CharField.__init__(self, verbose_name, name, **kwargs)
self.validators.append(validate_epic)
示例11: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, *args, **kwargs):
kwargs.setdefault('editable', False)
kwargs.setdefault('blank', False)
kwargs.setdefault('max_length', 25)
kwargs.setdefault('verbose_name', 'Salt')
CharField.__init__(self, *args, **kwargs)
示例12: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, *args, **kwargs):
kwargs.setdefault('editable', True)
kwargs.setdefault('max_length', 25)
kwargs.setdefault('choices', DATE_ESTIMATED)
kwargs.setdefault('help_text', _('If the exact date is not known, please indicate which part of the date is estimated.'))
CharField.__init__(self, *args, **kwargs)
示例13: __init__
# 需要导入模块: from django.db.models import CharField [as 别名]
# 或者: from django.db.models.CharField import __init__ [as 别名]
def __init__(self, *args, **kwargs):
kwargs.setdefault('blank', True)
CharField.__init__(self, *args, **kwargs)