当前位置: 首页>>代码示例>>Python>>正文


Python CharField.__init__方法代码示例

本文整理汇总了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)
开发者ID:botswana-harvard,项目名称:edc-base,代码行数:9,代码来源:custom_fields.py

示例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)
开发者ID:botswana-harvard,项目名称:edc,代码行数:9,代码来源:hostname_modification_field.py

示例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)
开发者ID:botswana-harvard,项目名称:edc,代码行数:9,代码来源:custom_fields.py

示例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)
开发者ID:Ellipsis753,项目名称:django-location-field-plain,代码行数:9,代码来源:models.py

示例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)
开发者ID:botswana-harvard,项目名称:edc,代码行数:9,代码来源:revision_field.py

示例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)
开发者ID:NOUSguide,项目名称:django-location-field,代码行数:10,代码来源:plain.py

示例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)
开发者ID:campherkurt,项目名称:django-sms-payments,代码行数:10,代码来源:fields.py

示例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)
开发者ID:myles-archive,项目名称:asgard-utils,代码行数:13,代码来源:fields.py

示例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)
开发者ID:sjlehtin,项目名称:django-extensions,代码行数:17,代码来源:__init__.py

示例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)
开发者ID:suriya,项目名称:save-your-vote,代码行数:6,代码来源:fields.py

示例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)
开发者ID:botswana-harvard,项目名称:edc,代码行数:8,代码来源:salt_field.py

示例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)
开发者ID:adrianveres,项目名称:tokafatso,代码行数:8,代码来源:fields.py

示例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)
开发者ID:botswana-harvard,项目名称:edc-base,代码行数:5,代码来源:hostname_modification_field.py


注:本文中的django.db.models.CharField.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。