bradleyayers/django-tables2 — Issue #59: Debian squeeze python/django version dependancies
Author: brianmay
Created: 2012-03-10 07:14:48+00:00
State: open

Unfortunately Debian stable only has Python 2.6. Fortunately, the solution is a one line change:

```diff
commit 46f7128107b29ed6521aa78a4e70a189a80e05dd
Author: Brian May
Date: Sat Mar 10 18:05:06 2012 +1100

Use old style syntax for exception, making it compatable with Python 2.6

diff --git a/django_tables2/columns.py b/django_tables2/columns.py
index 31ec9eb..186bb41 100644
--- a/django_tables2/columns.py
+++ b/django_tables2/columns.py
@@ -276,7 +276,7 @@ class LinkColumn(Column):
# and use that to decide whether to render a link or just the default
try:
raw = bound_column.accessor.resolve(record)
- except (TypeError, AttributeError, KeyError, ValueError) as e:
+ except (TypeError, AttributeError, KeyError, ValueError), e:
raw = None
if raw is None:
return self.default
```

Unfortunately this might break Python 3.x compatibility if that is desired.

django-tables2, unfortunately requires django >= 1.3, at least there is a backport available for Debian stable. This is required for django.test.client.RequestFactory

I see that django.test.client.RequestFactory is only required for one method; a method I don't use - would it be possible to make this import optional?