mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-30 01:46:24 +01:00
Fix CallableChoiceIterator import on Django 5.0+
This commit is contained in:
parent
27a8f85e1e
commit
4a097466eb
@ -4,7 +4,6 @@ from decimal import Decimal
|
||||
from django import forms
|
||||
from django.db.models import Model
|
||||
from django.db.models.fields import BLANK_CHOICE_DASH
|
||||
from django.forms.fields import CallableChoiceIterator
|
||||
from django.utils.dateparse import parse_date, parse_datetime, parse_time
|
||||
from django.utils.encoding import force_str
|
||||
from django.utils.functional import cached_property
|
||||
@ -24,6 +23,12 @@ from wagtail.telepath import Adapter, register
|
||||
|
||||
from .base import Block
|
||||
|
||||
try:
|
||||
from django.utils.choices import CallableChoiceIterator
|
||||
except ImportError:
|
||||
# DJANGO_VERSION < 5.0
|
||||
from django.forms.fields import CallableChoiceIterator
|
||||
|
||||
|
||||
class FieldBlock(Block):
|
||||
"""A block that wraps a Django form field"""
|
||||
|
Loading…
Reference in New Issue
Block a user