Django

Code

Show
Ignore:
Timestamp:
07/01/07 00:55:01 (1 year ago)
Author:
mtredinnick
Message:

unicode: Merged changes from trunk up to [5579].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/unicode

    • Property svnmerge-integrated changed from /django/trunk:1-5530 to /django/trunk:1-5579
  • django/branches/unicode/django/db/models/query.py

    r5531 r5580  
     1from django.conf import settings 
    12from django.db import backend, connection, transaction 
    23from django.db.models.fields import DateField, FieldDoesNotExist 
     
    2425    'startswith', 'istartswith', 'endswith', 'iendswith', 
    2526    'range', 'year', 'month', 'day', 'isnull', 'search', 
     27    'regex', 'iregex', 
    2628) 
    2729 
     
    799801    elif lookup_type == 'search': 
    800802        return backend.get_fulltext_search_sql(table_prefix + field_name) 
     803    elif lookup_type in ('regex', 'iregex'): 
     804        if settings.DATABASE_ENGINE == 'oracle': 
     805            if lookup_type == 'regex': 
     806                match_option = 'c' 
     807            else: 
     808                match_option = 'i' 
     809            return "REGEXP_LIKE(%s%s, %s, '%s')" % (table_prefix, field_name, cast_sql, match_option) 
     810        else: 
     811            raise NotImplementedError 
    801812    raise TypeError, "Got invalid lookup_type: %s" % repr(lookup_type) 
    802813