mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-26 11:33:55 +03:00
Improved Django 1.6 compatibility. Fixed #10
This commit is contained in:
parent
11300ab5f5
commit
0a42dcea02
|
@ -11,6 +11,13 @@ from graphene.core.fields import (
|
|||
)
|
||||
from graphene.contrib.django.fields import ConnectionOrListField, DjangoModelField
|
||||
|
||||
try:
|
||||
UUIDField = models.UUIDField
|
||||
except AttributeError:
|
||||
# Improved compatibility for Django 1.6
|
||||
class UUIDField(object):
|
||||
pass
|
||||
|
||||
|
||||
@singledispatch
|
||||
def convert_django_field(field):
|
||||
|
@ -24,7 +31,7 @@ def convert_django_field(field):
|
|||
@convert_django_field.register(models.EmailField)
|
||||
@convert_django_field.register(models.SlugField)
|
||||
@convert_django_field.register(models.URLField)
|
||||
@convert_django_field.register(models.UUIDField)
|
||||
@convert_django_field.register(UUIDField)
|
||||
def _(field):
|
||||
return StringField(description=field.help_text)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user