Skip to content

Commit 201fc66

Browse files
committed
formatting/style
1 parent 68e8d29 commit 201fc66

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

select_url_field/choice_with_other.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ChoiceWithOtherWidget(forms.MultiWidget):
1313
def __init__(self, choices, attrs=None):
1414
widgets = [
1515
forms.Select(choices=choices),
16-
forms.TextInput(attrs={'size':'80'})
16+
forms.TextInput(attrs={'size': '80'})
1717
]
1818
self.choices = choices
1919
super(ChoiceWithOtherWidget, self).__init__(widgets, attrs=attrs)

select_url_field/fields.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from django.utils.importlib import import_module
1717

1818

19-
from select_url_field.choice_with_other import ChoiceWithOtherField
19+
from .choice_with_other import ChoiceWithOtherField
2020

2121

2222
class SelectURLField(models.CharField):
@@ -53,6 +53,7 @@ def formfield(self, **kwargs):
5353
mod = import_module(mod_path)
5454
choices_func = getattr(mod, func_name)
5555
choices = choices_func()
56+
choices = [(x[1], x[0]) for x in choices]
5657
required = not self.blank
5758
return ChoiceWithOtherField(choices=choices, required=required)
5859

0 commit comments

Comments
 (0)