Browse Source

Merge "django22: Add 'renderer' argument"

tags/16.0.0.0b2
Zuul 1 week ago
parent
commit
fa34930110
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      horizon/forms/fields.py

+ 6
- 5
horizon/forms/fields.py View File

@@ -300,7 +300,7 @@ class SelectWidget(widgets.Widget):
300 300
 
301 301
 class ThemableSelectWidget(SelectWidget):
302 302
     """Bootstrap base select field widget."""
303
-    def render(self, name, value, attrs=None, choices=()):
303
+    def render(self, name, value, attrs=None, renderer=None, choices=()):
304 304
         # NOTE(woodnt): Currently the "attrs" contents are being added to the
305 305
         #               select that's hidden.  It's unclear whether this is the
306 306
         #               desired behavior.  In some cases, the attribute should
@@ -419,7 +419,7 @@ class ThemableCheckboxInput(widgets.CheckboxInput):
419 419
 
420 420
     It is used to allow a custom checkbox experience.
421 421
     """
422
-    def render(self, name, value, attrs=None):
422
+    def render(self, name, value, attrs=None, renderer=None):
423 423
         label_for = attrs.get('id', '')
424 424
 
425 425
         if not label_for:
@@ -481,7 +481,7 @@ class ChoiceInput(SubWidget):
481 481
     def __str__(self):
482 482
         return self.render()
483 483
 
484
-    def render(self, name=None, value=None, attrs=None):
484
+    def render(self, name=None, value=None, attrs=None, renderer=None):
485 485
         if self.id_for_label:
486 486
             label_for = html.format_html(' for="{}"', self.id_for_label)
487 487
         else:
@@ -535,7 +535,8 @@ class ThemableCheckboxChoiceInput(ChoiceInput):
535 535
             return self.choice_value in self.value
536 536
         return False
537 537
 
538
-    def render(self, name=None, value=None, attrs=None, choices=()):
538
+    def render(self, name=None, value=None, attrs=None, renderer=None,
539
+               choices=()):
539 540
         if self.id_for_label:
540 541
             label_for = html.format_html(' for="{}"', self.id_for_label)
541 542
         else:
@@ -554,7 +555,7 @@ class ThemableCheckboxSelectMultiple(widgets.CheckboxSelectMultiple):
554 555
     outer_html = '<ul{id_attr}>{content}</ul>'
555 556
     inner_html = '<li>{choice_value}{sub_widgets}</li>'
556 557
 
557
-    def render(self, name=None, value=None, attrs=None):
558
+    def render(self, name=None, value=None, attrs=None, renderer=None):
558 559
         """Outputs a <ul> for this set of choice fields.
559 560
 
560 561
         If an id was given to the field, it is applied to the <ul> (each

Loading…
Cancel
Save