예제 #1
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.limit = kwargs.pop('limit', None)
     widget = kwargs.get('widget', self.widget) or self.widget
     if isinstance(widget, type):
         kwargs['widget'] = widget(lookup_class, limit=self.limit)
     super(AutoCompleteSelectMultipleField, self).__init__(*args, **kwargs)
예제 #2
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.limit = kwargs.pop('limit', None)
     widget = kwargs.get('widget', self.widget) or self.widget
     if isinstance(widget, type):
         kwargs['widget'] = widget(lookup_class, limit=self.limit)
     super(AutoCompleteSelectMultipleField, self).__init__(*args, **kwargs)
예제 #3
0
파일: fields.py 프로젝트: JamesX88/tes
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.allow_new = kwargs.pop("allow_new", False)
     self.limit = kwargs.pop("limit", None)
     widget = kwargs.get("widget", self.widget) or self.widget
     if isinstance(widget, type):
         kwargs["widget"] = widget(lookup_class, allow_new=self.allow_new, limit=self.limit)
     super(AutoCompleteSelectField, self).__init__(*args, **kwargs)
예제 #4
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.allow_new = kwargs.pop('allow_new', False)
     self.limit = kwargs.pop('limit', None)
     widget = kwargs.get('widget', self.widget) or self.widget
     if isinstance(widget, type):
         kwargs['widget'] = widget(lookup_class,
                                   allow_new=self.allow_new,
                                   limit=self.limit)
     super().__init__(*args, **kwargs)
예제 #5
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.limit = kwargs.pop("limit", None)
     position = kwargs.pop("position", "bottom")
     attrs = {"data-selectable-multiple": "true", "data-selectable-position": position}
     attrs.update(kwargs.get("attrs", {}))
     query_params = kwargs.pop("query_params", {})
     widgets = [
         AutoComboboxWidget(lookup_class, allow_new=False, limit=self.limit, query_params=query_params, attrs=attrs),
         LookupMultipleHiddenInput(lookup_class),
     ]
     super(AutoComboboxSelectMultipleWidget, self).__init__(widgets, *args, **kwargs)
예제 #6
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.allow_new = kwargs.pop('allow_new', False)
     self.limit = kwargs.pop('limit', None)
     query_params = kwargs.pop('query_params', {})
     widgets = [
         self.primary_widget(
             lookup_class, allow_new=self.allow_new,
             limit=self.limit, query_params=query_params,
             attrs=kwargs.get('attrs'),
         ),
         forms.HiddenInput(attrs={'data-selectable-type': 'hidden'})
     ]
     super(_BaseSingleSelectWidget, self).__init__(widgets, *args, **kwargs)
예제 #7
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.allow_new = kwargs.pop('allow_new', False)
     self.limit = kwargs.pop('limit', None)
     query_params = kwargs.pop('query_params', {})
     widgets = [
         self.primary_widget(
             lookup_class, allow_new=self.allow_new,
             limit=self.limit, query_params=query_params,
             attrs=kwargs.get('attrs'),
         ),
         forms.HiddenInput(attrs={'data-selectable-type': 'hidden'})
     ]
     super(_BaseSingleSelectWidget, self).__init__(widgets, *args, **kwargs)
예제 #8
0
파일: widgets.py 프로젝트: 18dubu/MMS
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.allow_new = kwargs.pop("allow_new", False)
     self.limit = kwargs.pop("limit", None)
     query_params = kwargs.pop("query_params", {})
     widgets = [
         self.primary_widget(
             lookup_class,
             allow_new=self.allow_new,
             limit=self.limit,
             query_params=query_params,
             attrs=kwargs.get("attrs"),
         ),
         forms.HiddenInput(attrs={"data-selectable-type": "hidden"}),
     ]
     super(_BaseSingleSelectWidget, self).__init__(widgets, *args, **kwargs)
예제 #9
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.limit = kwargs.pop('limit', None)
     position = kwargs.pop('position', 'bottom')
     attrs = {
         'data-selectable-multiple': 'true',
         'data-selectable-position': position
     }
     attrs.update(kwargs.get('attrs', {}))
     query_params = kwargs.pop('query_params', {})
     widgets = [
         self.primary_widget(
             lookup_class, allow_new=False,
             limit=self.limit, query_params=query_params, attrs=attrs
         ),
         LookupMultipleHiddenInput(lookup_class)
     ]
     super(_BaseMultipleSelectWidget, self).__init__(widgets, *args, **kwargs)
예제 #10
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.limit = kwargs.pop('limit', None)
     position = kwargs.pop('position', 'bottom')
     attrs = {
         'data-selectable-multiple': 'true',
         'data-selectable-position': position
     }
     attrs.update(kwargs.get('attrs', {}))
     query_params = kwargs.pop('query_params', {})
     widgets = [
         self.primary_widget(
             lookup_class, allow_new=False,
             limit=self.limit, query_params=query_params, attrs=attrs
         ),
         LookupMultipleHiddenInput(lookup_class)
     ]
     super(_BaseMultipleSelectWidget, self).__init__(widgets, *args, **kwargs)
예제 #11
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.allow_new = kwargs.pop('allow_new', False)
     self.qs = kwargs.pop('query_params', {})
     self.limit = kwargs.pop('limit', None)
     super(AutoCompleteWidget, self).__init__(*args, **kwargs)
예제 #12
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     super(LookupMultipleHiddenInput, self).__init__(*args, **kwargs)
예제 #13
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     self.allow_new = kwargs.pop('allow_new', False)
     self.qs = kwargs.pop('query_params', {})
     self.limit = kwargs.pop('limit', None)
     super(AutoCompleteWidget, self).__init__(*args, **kwargs)
예제 #14
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     super(LookupMultipleHiddenInput, self).__init__(*args, **kwargs)
예제 #15
0
 def __init__(self, lookup_class, *args, **kwargs):
     self.lookup_class = import_lookup_class(lookup_class)
     super().__init__(*args, **kwargs)