mqsoh/django-gfklookupwidget — pull request #2 by danieljb (2014-03-17 22:34:17+00:00)
Title: Add 0 ordinal to string formatter for Python 2.6 compatibility

Hi,

a ValueError is raised when using gfklookupwidget with Python 2.6:

```python
ValueError: zero length field name in format
```

This could be prevented by adding the 0 ordinal to the string formatter in line 83 of `widgets.py`:

```python
# widgets.py
# ...
url += '?t={0}'.format(ct_field.rel.get_related_field().name)
```

The implicit positional formatter is added in [Python 2.7](http://docs.python.org/2/library/string.html#format-string-syntax) and ([Python 3.1](http://docs.python.org/3/library/string.html#format-string-syntax) respectively):

> Changed in version 2.7: The positional argument specifiers can be omitted,
> so '{} {}' is equivalent to '{0} {1}'.

Apart from this nitpick: thanks for easing the django admin’s `GenericForeignKey` pain!