diff --git a/views.py b/views.py
index b6d7fd422692be4cff0b072a33c6cf369b95559e_dmlld3MucHk=..eebe8dab2cc2eb1af9e83d4102e9dcf646e6c19e_dmlld3MucHk= 100644
--- a/views.py
+++ b/views.py
@@ -14,8 +14,6 @@
 from cubicweb.web.views import primary
 from cubicweb.web.views.autoform import AutomaticEntityForm
 
-from cubes.preview.views.forms import PreviewFormMixin
-
 uicfg.primaryview_section.tag_attribute(('Card', 'title'), 'hidden')
 uicfg.primaryview_section.tag_attribute(('Card', 'synopsis'), 'hidden')
 uicfg.primaryview_section.tag_attribute(('Card', 'wikiid'), 'hidden')
@@ -43,11 +41,8 @@
     def content_navigation_components(self, context):
         pass
 
-class PreviewAutomaticEntityForm(PreviewFormMixin, AutomaticEntityForm):
-    preview_mode = 'inline'
-    __select__ = AutomaticEntityForm.__select__ & is_instance('Card')
 
 def registration_callback(vreg):
     vreg.register(CardPrimaryView)
     vreg.register(CardInlinedView)
     if 'preview' in vreg.config.cubes():
@@ -49,7 +44,13 @@
 
 def registration_callback(vreg):
     vreg.register(CardPrimaryView)
     vreg.register(CardInlinedView)
     if 'preview' in vreg.config.cubes():
+
+        from cubes.preview.views.forms import PreviewFormMixin
+        class PreviewAutomaticEntityForm(PreviewFormMixin, AutomaticEntityForm):
+            preview_mode = 'inline'
+            __select__ = AutomaticEntityForm.__select__ & is_instance('Card')
+
         vreg.register(PreviewAutomaticEntityForm)