Django

Code

Show
Ignore:
Timestamp:
08/11/08 07:11:25 (4 months ago)
Author:
russellm
Message:

Fixed #5461 -- Refactored the database backend code to use classes for the creation and introspection modules. Introduces a new validation module for DB-specific validation. This is a backwards incompatible change; see the wiki for details.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/backends/models.py

    r7294 r8296  
    1616        return u'%s %s' % (self.first_name, self.last_name) 
    1717 
    18 if connection.features.uses_case_insensitive_names: 
    19     t_convert = lambda x: x.upper() 
    20 else: 
    21     t_convert = lambda x: x 
    2218qn = connection.ops.quote_name 
    2319 
     
    3026>>> f1, f2 = opts.get_field('root'), opts.get_field('square') 
    3127>>> query = ('INSERT INTO %s (%s, %s) VALUES (%%s, %%s)' 
    32 ...         % (t_convert(opts.db_table), qn(f1.column), qn(f2.column))) 
     28...         % (connection.introspection.table_name_converter(opts.db_table), qn(f1.column), qn(f2.column))) 
    3329>>> cursor.executemany(query, [(i, i**2) for i in range(-5, 6)]) and None or None 
    3430>>> Square.objects.order_by('root') 
     
    4945>>> f3, f4 = opts2.get_field('first_name'), opts2.get_field('last_name') 
    5046>>> query2 = ('SELECT %s, %s FROM %s ORDER BY %s' 
    51 ...          % (qn(f3.column), qn(f4.column), t_convert(opts2.db_table), 
     47...          % (qn(f3.column), qn(f4.column), connection.introspection.table_name_converter(opts2.db_table), 
    5248...             qn(f3.column))) 
    5349>>> cursor.execute(query2) and None or None