Django

Code

Changeset 5319

Show
Ignore:
Timestamp:
05/22/07 12:21:08 (1 year ago)
Author:
bouldersprinters
Message:

boulder-oracle-sprint: Merged to [5318]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/boulder-oracle-sprint/django/contrib/admin/templatetags/admin_list.py

    r5307 r5319  
    7373        try: 
    7474            f = lookup_opts.get_field(field_name) 
     75            admin_order_field = None 
    7576        except models.FieldDoesNotExist: 
    7677            # For non-field list_display values, check for the function 
     
    8788 
    8889            # It is a non-field, but perhaps one that is sortable 
    89             if not getattr(getattr(cl.model, field_name), "admin_order_field", None): 
     90            admin_order_field = getattr(getattr(cl.model, field_name), "admin_order_field", None) 
     91            if not admin_order_field: 
    9092                yield {"text": header} 
    9193                continue 
     
    102104        th_classes = [] 
    103105        new_order_type = 'asc' 
    104         if field_name == cl.order_field
     106        if field_name == cl.order_field or admin_order_field == cl.order_field
    105107            th_classes.append('sorted %sending' % cl.order_type.lower()) 
    106108            new_order_type = {'asc': 'desc', 'desc': 'asc'}[cl.order_type.lower()] 
  • django/branches/boulder-oracle-sprint/django/core/serializers/json.py

    r5307 r5319  
    3636    else: 
    3737        stream = stream_or_string 
    38     #for obj in PythonDeserializer(simplejson.load(stream, cls=DjangoJSONDecoder)): 
    3938    for obj in PythonDeserializer(simplejson.load(stream)): 
    4039        yield obj 
     
    6362DateTimeAwareJSONEncoder = DjangoJSONEncoder 
    6463 
    65 ## Our override for simplejson.JSONNumber, because we want to use decimals in 
    66 ## preference to floats (we can convert decimal -> float when they stored, if 
    67 ## needed, but cannot go the other way). 
    68 #def DjangoNumber(match, context): 
    69 #    match = DjangoNumber.regex.match(match.string, *match.span()) 
    70 #    integer, frac, exp = match.groups() 
    71 #    if exp: 
    72 #        res = float(integer + (frac or '') + (exp or '')) 
    73 #    elif frac: 
    74 #        res = decimal.Decimal(integer + frac) 
    75 #    else: 
    76 #        res = int(integer) 
    77 #    return res, None 
    78 #decoder.pattern(r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?')(DjangoNumber) 
    79 # 
    80 #converters = decoder.ANYTHING[:] 
    81 #converters[-1] = DjangoNumber 
    82 #decoder.JSONScanner = decoder.Scanner(converters) 
    83 # 
    84 #class DjangoJSONDecoder(simplejson.JSONDecoder): 
    85 #    _scanner = decoder.Scanner(converters) 
    86 # 
  • django/branches/boulder-oracle-sprint/django/db/backends/mysql_old/base.py

    r5307 r5319  
    2626    FIELD_TYPE.TIME: util.typecast_time, 
    2727    FIELD_TYPE.DECIMAL: util.typecast_decimal, 
    28     FIELD_TYPE.NEWDECIMAL: util.typecast_decimal, 
    2928}) 
    3029 
  • django/branches/boulder-oracle-sprint/docs/model-api.txt

    r5307 r5319  
    186186 
    187187``DecimalField`` 
    188 ~~~~~~~~~~~~~~ 
     188~~~~~~~~~~~~~~~~ 
     189 
     190**New in Django development version** 
    189191 
    190192A fixed-precision decimal number, represented in Python by a ``Decimal`` instance. 
     
    318320~~~~~~~~~~~~~~ 
    319321 
     322**Changed in Django development version** 
     323 
    320324A floating-point number represented in Python by a ``float`` instance. 
    321325 
    322326The admin represents this as an ``<input type="text">`` (a single-line input). 
     327 
     328**NOTE:** The semantics of ``FloatField`` have changed in the Django 
     329development version. See the `Django 0.96 documentation`_ for the old behavior. 
     330 
     331.. _Django 0.96 documentation: http://www.djangoproject.com/documentation/0.96/model-api/#floatfield 
    323332 
    324333``ImageField``