(cls, items, **kwargs)
| 2754 | |
| 2755 | @classmethod |
| 2756 | def new_from_list(cls, items, **kwargs): |
| 2757 | item = None |
| 2758 | obj = cls(**kwargs) |
| 2759 | for item in items: |
| 2760 | obj.append(DropDownItem(item)) |
| 2761 | if item is not None: |
| 2762 | try: |
| 2763 | obj.select_by_value(item) # ensure one is selected |
| 2764 | except UnboundLocalError: |
| 2765 | pass |
| 2766 | return obj |
| 2767 | |
| 2768 | def append(self, value, key=''): |
| 2769 | if isinstance(value, type('')) or isinstance(value, type(u'')): |
nothing calls this directly
no test coverage detected