Django

Code

Changeset 9548

Show
Ignore:
Timestamp:
12/02/08 12:40:40 (1 month ago)
Author:
ikelly
Message:

Fixed #9706: made SlugField? honor max_length in Oracle, matching the other backends.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/backends/oracle/creation.py

    r8819 r9548  
    3333        'PositiveIntegerField':         'NUMBER(11) CHECK (%(qn_column)s >= 0)', 
    3434        'PositiveSmallIntegerField':    'NUMBER(11) CHECK (%(qn_column)s >= 0)', 
    35         'SlugField':                    'NVARCHAR2(50)', 
     35        'SlugField':                    'NVARCHAR2(%(max_length)s)', 
    3636        'SmallIntegerField':            'NUMBER(11)', 
    3737        'TextField':                    'NCLOB', 
  • django/trunk/tests/regressiontests/model_fields/models.py

    r9394 r9548  
    3636class BigD(models.Model): 
    3737    d = models.DecimalField(max_digits=38, decimal_places=30) 
     38 
     39class BigS(models.Model): 
     40    s = models.SlugField(max_length=255) 
    3841 
    3942__test__ = {'API_TESTS':""" 
     
    8992>>> bd.d == decimal.Decimal("12.9") 
    9093True 
     94 
     95# Regression test for #9706: ensure SlugField honors max_length. 
     96>>> bs = BigS.objects.create(s = 'slug' * 50) 
     97>>> bs = BigS.objects.get(pk=bs.pk) 
     98>>> bs.s == 'slug' * 50 
     99True 
    91100"""}