update copyright date
[matthijs/upstream/django-ldapdb.git] / ldapdb / models / fields.py
index 78ec1c7569f3421d2b856e2d78856f70cbed70da..6162c7f5a21bdca57be1e4d403d540446b799803 100644 (file)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 # 
 # django-ldapdb
-# Copyright (C) 2009 BollorĂ© telecom
+# Copyright (C) 2009-2010 BollorĂ© telecom
 # See AUTHORS file for a full list of contributors.
 # 
 # This program is free software: you can redistribute it and/or modify
 
 from django.db.models import fields, SubfieldBase
 
+from ldapdb import escape_ldap_filter
+
 class CharField(fields.CharField):
     def __init__(self, *args, **kwargs):
         kwargs['max_length'] = 200
         super(CharField, self).__init__(*args, **kwargs)
 
+    def get_prep_lookup(self, lookup_type, value):
+        return escape_ldap_filter(value)
+        
 class ImageField(fields.Field):
     pass