Django

Code

Show
Ignore:
Timestamp:
07/04/08 15:16:22 (5 months ago)
Author:
jbronn
Message:

gis: Merged revisions 7772-7808,7811-7814,7816-7823,7826-7829,7831-7833,7835 via svnmerge from trunk. Modified GeoWhereNode accordingly for changes in r7835.

Files:

Legend:

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

    • Property svnmerge-integrated changed from /django/trunk:1-7767 to /django/trunk:1-7835
  • django/branches/gis/django/contrib/gis/db/backend/oracle/query.py

    r7641 r7836  
    111111 
    112112#### The `get_geo_where_clause` function for Oracle #### 
    113 def get_geo_where_clause(lookup_type, table_prefix, field, value): 
     113def get_geo_where_clause(table_alias, name, lookup_type, geo_annot): 
    114114    "Returns the SQL WHERE clause for use in Oracle spatial SQL construction." 
    115115    # Getting the quoted table name as `geo_col`. 
    116     geo_col = '%s.%s' % (qn(table_prefix), qn(field.column)) 
     116    geo_col = '%s.%s' % (qn(table_alias), qn(name)) 
    117117 
    118118    # See if a Oracle Geometry function matches the lookup type next 
     
    127127 
    128128            # Ensuring that a tuple _value_ was passed in from the user 
    129             if not isinstance(value, tuple): 
     129            if not isinstance(geo_annot.value, tuple): 
    130130                raise TypeError('Tuple required for `%s` lookup type.' % lookup_type) 
    131             if len(value) != 2:  
     131            if len(geo_annot.value) != 2:  
    132132                raise ValueError('2-element tuple required for %s lookup type.' % lookup_type) 
    133133             
    134134            # Ensuring the argument type matches what we expect. 
    135             if not isinstance(value[1], arg_type): 
    136                 raise TypeError('Argument type should be %s, got %s instead.' % (arg_type, type(value[1]))) 
     135            if not isinstance(geo_annot.value[1], arg_type): 
     136                raise TypeError('Argument type should be %s, got %s instead.' % (arg_type, type(geo_annot.value[1]))) 
    137137 
    138138            if lookup_type == 'relate': 
    139139                # The SDORelate class handles construction for these queries,  
    140140                # and verifies the mask argument. 
    141                 return sdo_op(value[1]).as_sql(geo_col) 
     141                return sdo_op(geo_annot.value[1]).as_sql(geo_col) 
    142142            else: 
    143143                # Otherwise, just call the `as_sql` method on the SDOOperation instance. 
     
    150150    elif lookup_type == 'isnull': 
    151151        # Handling 'isnull' lookup type 
    152         return "%s IS %sNULL" % (geo_col, (not value and 'NOT ' or '')) 
     152        return "%s IS %sNULL" % (geo_col, (not geo_annot.value and 'NOT ' or '')) 
    153153 
    154154    raise TypeError("Got invalid lookup_type: %s" % repr(lookup_type))