prevent lookups on ImageField and ListField for now
authorjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Mon, 24 May 2010 07:50:13 +0000 (07:50 +0000)
committerjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Mon, 24 May 2010 07:50:13 +0000 (07:50 +0000)
git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@861 e071eeec-0327-468d-9b6a-08194a12b294

ldapdb/models/fields.py

index f269d7c126f42fb9b829210094a9e08e5b9ef504..ff0ad722b8e75a8d0067933be4637170e1cf426b 100644 (file)
@@ -45,7 +45,8 @@ class CharField(fields.CharField):
         return escape_ldap_filter(value)
         
 class ImageField(fields.Field):
-    pass
+    def get_db_prep_lookup(self, lookup_type, value):
+        raise TypeError("ImageField has invalid lookup: %s" % lookup_type)
 
 class IntegerField(fields.IntegerField):
     def get_db_prep_lookup(self, lookup_type, value):
@@ -57,6 +58,9 @@ class IntegerField(fields.IntegerField):
 class ListField(fields.Field):
     __metaclass__ = SubfieldBase
 
+    def get_db_prep_lookup(self, lookup_type, value):
+        raise TypeError("ListField has invalid lookup: %s" % lookup_type)
+
     def to_python(self, value):
         if not value:
             return []