From: jlaine Date: Mon, 24 May 2010 07:50:13 +0000 (+0000) Subject: prevent lookups on ImageField and ListField for now X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=4a1abcd053ba73b2c7e2db1068eb400468906e1a;p=matthijs%2Fupstream%2Fdjango-ldapdb.git 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 --- 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 []