22from django .conf import settings as django_settings
33from django .db .models .fields .related import ManyToOneRel
44from django .utils .translation import gettext_lazy as _
5- from entangled .forms import EntangledModelForm
65from filer .fields .image import AdminImageFormField , FilerImageField
76from filer .models import Image , ThumbnailOption
87
@@ -45,13 +44,6 @@ def get_templates():
4544PICTURE_ALIGNMENT = get_alignment ()
4645
4746
48- LINK_TARGET = (
49- ("_blank" , _ ("Open in new window" )),
50- ("_self" , _ ("Open in same window" )),
51- ("_parent" , _ ("Delegate to parent" )),
52- ("_top" , _ ("Delegate to top" )),
53- )
54-
5547RESPONSIVE_IMAGE_CHOICES = (
5648 ("inherit" , _ ("Let settings.DJANGOCMS_PICTURE_RESPONSIVE_IMAGES decide" )),
5749 ("yes" , _ ("Yes" )),
@@ -61,10 +53,9 @@ def get_templates():
6153
6254class ImageForm (
6355 TemplateChoiceMixin ,
64- AbstractLinkForm ,
6556 ResponsiveFormMixin ,
6657 MarginFormMixin ,
67- EntangledModelForm ,
58+ AbstractLinkForm ,
6859):
6960 """
7061 Content > "Image" Plugin
@@ -217,24 +208,6 @@ class Meta:
217208 def clean (self ):
218209 super ().clean ()
219210 data = self .cleaned_data
220- # there can be only one link type
221- if (
222- sum (
223- (
224- bool (data .get ("external_link" , False )),
225- bool (data .get ("internal_link" , False )),
226- bool (data .get ("file_link" , False )),
227- )
228- )
229- > 1
230- ):
231- raise forms .ValidationError (
232- _ (
233- "You have given more than one external, internal, or file link target. "
234- "Only one option is allowed."
235- )
236- )
237-
238211 # you shall only set one image kind
239212 if not data .get ("picture" , False ) and not data .get ("external_picture" , False ):
240213 raise forms .ValidationError (
0 commit comments