[Python-modules-commits] r31100 - in packages/django-tables/trunk/debian/patches (2 files)

bam at users.alioth.debian.org bam at users.alioth.debian.org
Thu Oct 16 23:25:30 UTC 2014


    Date: Thursday, October 16, 2014 @ 23:25:29
  Author: bam
Revision: 31100

Actually add the patches.

Added:
  packages/django-tables/trunk/debian/patches/dont_call_managers.patch
  packages/django-tables/trunk/debian/patches/remove_sorteddict.patch

Added: packages/django-tables/trunk/debian/patches/dont_call_managers.patch
===================================================================
--- packages/django-tables/trunk/debian/patches/dont_call_managers.patch	                        (rev 0)
+++ packages/django-tables/trunk/debian/patches/dont_call_managers.patch	2014-10-16 23:25:29 UTC (rev 31100)
@@ -0,0 +1,14 @@
+Index: django-tables/django_tables2/utils.py
+===================================================================
+--- django-tables.orig/django_tables2/utils.py	2014-02-02 20:07:17.000000000 +1100
++++ django-tables/django_tables2/utils.py	2014-10-17 09:54:00.073175687 +1100
+@@ -377,7 +377,8 @@
+                     if safe and getattr(current, 'alters_data', False):
+                         raise ValueError('refusing to call %s() because `.alters_data = True`'
+                                          % repr(current))
+-                    current = current()
++                    if not getattr(current, 'do_not_call_in_templates', False):
++                        current = current()
+                 # important that we break in None case, or a relationship
+                 # spanning across a null-key will raise an exception in the
+                 # next iteration, instead of defaulting.

Added: packages/django-tables/trunk/debian/patches/remove_sorteddict.patch
===================================================================
--- packages/django-tables/trunk/debian/patches/remove_sorteddict.patch	                        (rev 0)
+++ packages/django-tables/trunk/debian/patches/remove_sorteddict.patch	2014-10-16 23:25:29 UTC (rev 31100)
@@ -0,0 +1,97 @@
+Index: django-tables/django_tables2/columns/base.py
+===================================================================
+--- django-tables.orig/django_tables2/columns/base.py	2014-02-02 20:07:17.000000000 +1100
++++ django-tables/django_tables2/columns/base.py	2014-10-17 10:03:42.751724866 +1100
+@@ -1,7 +1,7 @@
+ # coding: utf-8
+ from __future__ import absolute_import, unicode_literals
+ from django.db.models.fields import FieldDoesNotExist
+-from django.utils.datastructures import SortedDict
++from collections import OrderedDict
+ from django.utils.safestring import SafeData
+ from django_tables2.templatetags.django_tables2 import title
+ from django_tables2.utils import A, AttributeDict, OrderBy, OrderByTuple
+@@ -518,7 +518,7 @@
+     A `BoundColumns` object is a container for holding `BoundColumn` objects.
+     It provides methods that make accessing columns easier than if they were
+     stored in a `list` or `dict`. `Columns` has a similar API to a `dict` (it
+-    actually uses a `~django.utils.datastructures.SortedDict` interally).
++    actually uses a `~collections.OrderedDict` interally).
+ 
+     At the moment you'll only come across this class when you access a
+     `.Table.columns` property.
+@@ -528,7 +528,7 @@
+     """
+     def __init__(self, table):
+         self.table = table
+-        self.columns = SortedDict()
++        self.columns = OrderedDict()
+         for name, column in six.iteritems(table.base_columns):
+             self.columns[name] = bc = BoundColumn(table, column, name)
+             bc.render = getattr(table, 'render_' + name, column.render)
+Index: django-tables/django_tables2/tables.py
+===================================================================
+--- django-tables.orig/django_tables2/tables.py	2014-02-02 20:07:17.000000000 +1100
++++ django-tables/django_tables2/tables.py	2014-10-17 10:03:12.888413668 +1100
+@@ -8,7 +8,7 @@
+ import copy
+ from django.core.paginator       import Paginator
+ from django.db.models.fields     import FieldDoesNotExist
+-from django.utils.datastructures import SortedDict
++from collections                 import OrderedDict
+ from django.template             import RequestContext
+ from django.template.loader      import get_template
+ import six
+@@ -168,10 +168,10 @@
+             if hasattr(base, "base_columns"):
+                 parent_columns = list(base.base_columns.items()) + parent_columns
+         # Start with the parent columns
+-        attrs["base_columns"] = SortedDict(parent_columns)
++        attrs["base_columns"] = OrderedDict(parent_columns)
+         # Possibly add some generated columns based on a model
+         if opts.model:
+-            extra = SortedDict()
++            extra = OrderedDict()
+             # honor Table.Meta.fields, fallback to model._meta.fields
+             if opts.fields:
+                 # Each item in opts.fields is the name of a model field or a
+@@ -190,7 +190,7 @@
+             attrs["base_columns"].update(extra)
+ 
+         # Explicit columns override both parent and generated columns
+-        attrs["base_columns"].update(SortedDict(cols))
++        attrs["base_columns"].update(OrderedDict(cols))
+         # Apply any explicit exclude setting
+         for exclusion in opts.exclude:
+             if exclusion in attrs["base_columns"]:
+@@ -200,7 +200,7 @@
+             opts.sequence.expand(attrs["base_columns"].keys())
+             # Table's sequence defaults to sequence declared in Meta
+             #attrs['_sequence'] = opts.sequence
+-            attrs["base_columns"] = SortedDict(((x, attrs["base_columns"][x]) for x in opts.sequence))
++            attrs["base_columns"] = OrderedDict(((x, attrs["base_columns"][x]) for x in opts.sequence))
+ 
+         # set localize on columns
+         for col_name in attrs["base_columns"].keys():
+Index: django-tables/django_tables2/templatetags/django_tables2.py
+===================================================================
+--- django-tables.orig/django_tables2/templatetags/django_tables2.py	2014-02-02 20:07:17.000000000 +1100
++++ django-tables/django_tables2/templatetags/django_tables2.py	2014-10-17 10:03:12.888413668 +1100
+@@ -5,7 +5,7 @@
+ from django.template import TemplateSyntaxError, Variable, Node
+ from django.template.loader import get_template, select_template
+ from django.template.defaultfilters import stringfilter, title as old_title
+-from django.utils.datastructures import SortedDict
++from collections import OrderedDict
+ from django.utils.http import urlencode
+ from django.utils.html import escape
+ from django.utils.safestring import mark_safe
+@@ -35,7 +35,7 @@
+     """
+     if not bits:
+         return {}
+-    kwargs = SortedDict()
++    kwargs = OrderedDict()
+     while bits:
+         match = kwarg_re.match(bits[0])
+         if not match or not match.group(1):




More information about the Python-modules-commits mailing list