From 4a1abcd053ba73b2c7e2db1068eb400468906e1a Mon Sep 17 00:00:00 2001 From: jlaine Date: Mon, 24 May 2010 07:50:13 +0000 Subject: [PATCH] prevent lookups on ImageField and ListField for now git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@861 e071eeec-0327-468d-9b6a-08194a12b294 --- ldapdb/models/fields.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ldapdb/models/fields.py b/ldapdb/models/fields.py index f269d7c..ff0ad72 100644 --- a/ldapdb/models/fields.py +++ b/ldapdb/models/fields.py @@ -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 [] -- 2.30.2