X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=ldapdb%2Fmodels%2Ffields.py;h=6162c7f5a21bdca57be1e4d403d540446b799803;hb=23a36d706cedeed4d02d0f97b46669403ce5b943;hp=78ec1c7569f3421d2b856e2d78856f70cbed70da;hpb=6114ec0f3314013175cc55886f2cd6085d8ae1d0;p=matthijs%2Fupstream%2Fdjango-ldapdb.git diff --git a/ldapdb/models/fields.py b/ldapdb/models/fields.py index 78ec1c7..6162c7f 100644 --- a/ldapdb/models/fields.py +++ b/ldapdb/models/fields.py @@ -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 @@ -20,11 +20,16 @@ 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