sentry #192
authorOlivier Larchevêque <olivier.larcheveque@auf.org>
Wed, 3 Oct 2012 18:51:26 +0000 (14:51 -0400)
committerOlivier Larchevêque <olivier.larcheveque@auf.org>
Wed, 3 Oct 2012 18:51:26 +0000 (14:51 -0400)
src/qbe/django_qbe/forms.py

index d926cbb..64ecae7 100644 (file)
@@ -200,8 +200,14 @@ class BaseQueryByExampleFormSet(BaseFormSet):
                 is_join = operator.lower() == 'join'
             except:
                 is_join = False
+                
             if show and not is_join:
-                selects.append(db_field)
+                try:
+                    self._models[model]._meta.get_field(field)
+                    selects.append(db_field)
+                except:
+                    # dynamic field can't be viewable
+                    pass
             if sort:
                 sorts.append((db_field, sort))
             if status: