我们从Python开源项目中,提取了以下29个代码示例,用于说明如何使用django.forms.UUIDField()。
def __init__(self, verbose_name=None, **kwargs): kwargs['max_length'] = 32 super(UUIDField, self).__init__(verbose_name, **kwargs)
def deconstruct(self): name, path, args, kwargs = super(UUIDField, self).deconstruct() del kwargs['max_length'] return name, path, args, kwargs
def get_internal_type(self): return "UUIDField"
def formfield(self, **kwargs): defaults = { 'form_class': forms.UUIDField, } defaults.update(kwargs) return super(UUIDField, self).formfield(**defaults)
def test_should_uuid_convert_string(): if hasattr(forms, 'UUIDField'): assert_conversion(forms.UUIDField, graphene.UUID)