Skip to content

Commit

Permalink
try catch import to support less than v5
Browse files Browse the repository at this point in the history
  • Loading branch information
lautarodapin-magoya committed Nov 8, 2024
1 parent 6049117 commit 2d44cde
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion djangoql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
from django.core.exceptions import FieldDoesNotExist
from django.db import models
from django.db.models import ManyToManyRel, ManyToOneRel
from django.db.models.fields.generated import GeneratedField
from django.db.models.fields.related import ForeignObjectRel
from django.utils.timezone import get_current_timezone

from .ast import Comparison, Const, List, Logical, Name, Node
from .compat import text_type
from .exceptions import DjangoQLSchemaError

try:
from django.db.models.fields.generated import GeneratedField # Django >= 5.0
except ImportError:
GeneratedField = None


class DjangoQLField(object):
"""
Expand Down

0 comments on commit 2d44cde

Please sign in to comment.