3

I have a model form that is made up largely of django-autocomplete-light ModelSelect2 boxes:

class AlertForm(ModelForm):
    class Meta:
        model = Alert
        fields = '__all__'
        widgets = {
            'entity': ModelSelect2(url='eda', attrs={'data-minimum-input-length': 2}),
            'logic': ModelSelect2(url='logic', attrs{'class':'hello'})
        }

The CSS class hello which I am attempting to add to the logic select box does not appear when the page is rendered. How do I add a CSS class to a dal select box?

Edit: Even if this did add a class to the select box, the class actually needs to be added to the select container. How would this be accomplished?

OverflowingTheGlass
  • 2,324
  • 1
  • 27
  • 75

1 Answers1

0

You can use this CSS selector .class-name + span so u select span container and apply whatever CSS u want.

bezkos
  • 21
  • 1
  • 3