File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change 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
2222class 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
You can’t perform that action at this time.
0 commit comments