summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-05-22 17:21:08 +0000
committerBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-05-22 17:21:08 +0000
commit179a8c44bbe5deb80bd9ae2bc2ff65e3d0a71c03 (patch)
tree264a2236c1a9ef2f2aff738dd83678aeaf79d2ae
parent12b5df62dd8670c9dae2f77c7f7312e558a65104 (diff)
downloaddjango-179a8c44bbe5deb80bd9ae2bc2ff65e3d0a71c03.tar.gz
boulder-oracle-sprint: Merged to [5318]
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5319 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/admin/templatetags/admin_list.py6
-rw-r--r--django/core/serializers/json.py23
-rw-r--r--django/db/backends/mysql_old/base.py1
-rw-r--r--docs/model-api.txt11
4 files changed, 14 insertions, 27 deletions
diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py
index 0bf18d86cc..7ad66c250d 100644
--- a/django/contrib/admin/templatetags/admin_list.py
+++ b/django/contrib/admin/templatetags/admin_list.py
@@ -72,6 +72,7 @@ def result_headers(cl):
for i, field_name in enumerate(lookup_opts.admin.list_display):
try:
f = lookup_opts.get_field(field_name)
+ admin_order_field = None
except models.FieldDoesNotExist:
# For non-field list_display values, check for the function
# attribute "short_description". If that doesn't exist, fall
@@ -86,7 +87,8 @@ def result_headers(cl):
header = field_name.replace('_', ' ')
# It is a non-field, but perhaps one that is sortable
- if not getattr(getattr(cl.model, field_name), "admin_order_field", None):
+ admin_order_field = getattr(getattr(cl.model, field_name), "admin_order_field", None)
+ if not admin_order_field:
yield {"text": header}
continue
@@ -101,7 +103,7 @@ def result_headers(cl):
th_classes = []
new_order_type = 'asc'
- if field_name == cl.order_field:
+ if field_name == cl.order_field or admin_order_field == cl.order_field:
th_classes.append('sorted %sending' % cl.order_type.lower())
new_order_type = {'asc': 'desc', 'desc': 'asc'}[cl.order_type.lower()]
diff --git a/django/core/serializers/json.py b/django/core/serializers/json.py
index 20adce798d..55804b8316 100644
--- a/django/core/serializers/json.py
+++ b/django/core/serializers/json.py
@@ -35,7 +35,6 @@ def Deserializer(stream_or_string, **options):
stream = StringIO(stream_or_string)
else:
stream = stream_or_string
- #for obj in PythonDeserializer(simplejson.load(stream, cls=DjangoJSONDecoder)):
for obj in PythonDeserializer(simplejson.load(stream)):
yield obj
@@ -62,25 +61,3 @@ class DjangoJSONEncoder(simplejson.JSONEncoder):
# Older, deprecated class name (for backwards compatibility purposes).
DateTimeAwareJSONEncoder = DjangoJSONEncoder
-## Our override for simplejson.JSONNumber, because we want to use decimals in
-## preference to floats (we can convert decimal -> float when they stored, if
-## needed, but cannot go the other way).
-#def DjangoNumber(match, context):
-# match = DjangoNumber.regex.match(match.string, *match.span())
-# integer, frac, exp = match.groups()
-# if exp:
-# res = float(integer + (frac or '') + (exp or ''))
-# elif frac:
-# res = decimal.Decimal(integer + frac)
-# else:
-# res = int(integer)
-# return res, None
-#decoder.pattern(r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?')(DjangoNumber)
-#
-#converters = decoder.ANYTHING[:]
-#converters[-1] = DjangoNumber
-#decoder.JSONScanner = decoder.Scanner(converters)
-#
-#class DjangoJSONDecoder(simplejson.JSONDecoder):
-# _scanner = decoder.Scanner(converters)
-#
diff --git a/django/db/backends/mysql_old/base.py b/django/db/backends/mysql_old/base.py
index 4704fe80a5..ac3b75efde 100644
--- a/django/db/backends/mysql_old/base.py
+++ b/django/db/backends/mysql_old/base.py
@@ -25,7 +25,6 @@ django_conversions.update({
FIELD_TYPE.DATE: util.typecast_date,
FIELD_TYPE.TIME: util.typecast_time,
FIELD_TYPE.DECIMAL: util.typecast_decimal,
- FIELD_TYPE.NEWDECIMAL: util.typecast_decimal,
})
# This should match the numerical portion of the version numbers (we can treat
diff --git a/docs/model-api.txt b/docs/model-api.txt
index be5676b25e..1b1b405d35 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -185,7 +185,9 @@ The admin represents this as two ``<input type="text">`` fields, with
JavaScript shortcuts.
``DecimalField``
-~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~
+
+**New in Django development version**
A fixed-precision decimal number, represented in Python by a ``Decimal`` instance.
Has two **required** arguments:
@@ -317,10 +319,17 @@ because the ``match`` applies to the base filename (``foo.gif`` and
``FloatField``
~~~~~~~~~~~~~~
+**Changed in Django development version**
+
A floating-point number represented in Python by a ``float`` instance.
The admin represents this as an ``<input type="text">`` (a single-line input).
+**NOTE:** The semantics of ``FloatField`` have changed in the Django
+development version. See the `Django 0.96 documentation`_ for the old behavior.
+
+.. _Django 0.96 documentation: http://www.djangoproject.com/documentation/0.96/model-api/#floatfield
+
``ImageField``
~~~~~~~~~~~~~~