Ticket #1261: boulder-oracle-sprint-firebird-rev4212.patch
File boulder-oracle-sprint-firebird-rev4212.patch, 3.8 KB (added by , 18 years ago) |
---|
-
django/db/models/fields/__init__.py
407 407 raise validators.ValidationError, gettext_lazy("This field cannot be null.") 408 408 return str(value) 409 409 410 def get_db_prep_save(self, value): 411 return Field.get_db_prep_save(self, str(value)) 412 410 413 # TODO: Maybe move this into contrib, because it's specialized. 411 414 class CommaSeparatedIntegerField(CharField): 412 415 def get_manipulator_field_objs(self): … … 509 512 if settings.DATABASE_ENGINE in ('mysql', 'oracle') and hasattr(value, 'microsecond'): 510 513 value = value.replace(microsecond=0) 511 514 # cx_Oracle wants the raw datetime instead of a string. 512 if settings.DATABASE_ENGINE != 'oracle':515 if settings.DATABASE_ENGINE not in ('oracle', 'firebird'): 513 516 value = str(value) 514 517 return Field.get_db_prep_save(self, value) 515 518 516 519 def get_db_prep_lookup(self, lookup_type, value): 517 520 # Oracle will throw an error if microseconds are given, because it 518 521 # doesn't support microseconds. 519 if settings.DATABASE_ENGINE == 'oracle'and hasattr(value, 'microsecond'):522 if settings.DATABASE_ENGINE in ('oracle', 'firebird') and hasattr(value, 'microsecond'): 520 523 value = value.replace(microsecond=0) 521 524 if lookup_type == 'range': 522 525 value = [str(v) for v in value] -
django/db/models/query.py
657 657 else: 658 658 cast_sql = '%s' 659 659 try: 660 return '%s%s %s' % (table_prefix, field_name, 660 lookup_sql = '%s%s %s' 661 if (settings.DATABASE_ENGINE == 'firebird' and lookup_type[0] == 'i'): 662 lookup_sql = 'UPPER(%s%s) %s' 663 return lookup_sql % (table_prefix, field_name, 661 664 backend.OPERATOR_MAPPING[lookup_type] % cast_sql) 662 665 except KeyError: 663 666 pass -
django/core/management.py
163 163 # Make the definition (e.g. 'foo VARCHAR(30)') for this field. 164 164 field_output = [style.SQL_FIELD(backend.quote_name(f.column)), 165 165 style.SQL_COLTYPE(col_type % rel_field.__dict__)] 166 field_output.append(style.SQL_KEYWORD('%sNULL' % (not f.null and 'NOT ' or ' ')))166 field_output.append(style.SQL_KEYWORD('%sNULL' % (not f.null and 'NOT ' or 'DEFAULT '))) 167 167 if f.unique and (not f.primary_key or backend.allows_unique_and_pk): 168 168 field_output.append(style.SQL_KEYWORD('UNIQUE')) 169 169 if f.primary_key: … … 1177 1177 index_output = [] 1178 1178 for f in fields: 1179 1179 field_output = [backend.quote_name(f.name), data_types[f.get_internal_type()] % f.__dict__] 1180 field_output.append("%sNULL" % (not f.null and "NOT " or " "))1180 field_output.append("%sNULL" % (not f.null and "NOT " or "DEFAULT ")) 1181 1181 if f.unique: 1182 1182 field_output.append("UNIQUE") 1183 1183 if f.primary_key: -
tests/runtests.py
16 16 'django.contrib.auth', 17 17 'django.contrib.sites', 18 18 'django.contrib.flatpages', 19 'django.contrib.redirects',19 # 'django.contrib.redirects', 20 20 'django.contrib.sessions', 21 21 'django.contrib.comments', 22 22 'django.contrib.admin',