def add_css_classes(f, **kwargs):
    """
    Credits go to Ramen
    http://djangosnippets.org/snippets/2097/
    
    Formfield callback that adds a CSS class to every field indicating what kind of field it is.
    For example, all CharField inputs will get a class of "vCharField". If the field's widget already has a
    "class" attribute, it will be left alone.
    """

    field = f.formfield(**kwargs)
    if field and field.widget.attrs not in 'class':
        field.widget.attrs['class'] = 'v%s' % field.__class__.__name__
        
    return field
dataset/ETHPy150Open baskoopmans/djcommon/djcommon/forms.py/add_css_classes/swapped operands of `not in`