def do_field(self, name, field, count=0):
        fname = name%'id_%s'
        # TODO: make a special case for the split dt field (id_0,id_1)
        #if isinstance(field, fields.SplitDateTimeField):
        #    fname += '_%d'%count
        if field.__class__ in LV_FIELDS and not LV_FIELDS[field.__class__]:
            self.opts.update(onlyOnSubmit=True)        
        lv = LiveValidation(fname, **self.opts)
        fail = field.default_error_messages.get('invalid',None)
        extrakw = {'validMessage':' '}
        if fail:
            extrakw['failureMessage'] = str(fail[:])
        if self.formcls in LV_VALIDATORS:
            if name in LV_VALIDATORS[self.formcls]:
                for v,kw in LV_VALIDATORS[self.formcls][name].items():
                    extrakw.update(kw)
                    lv.add(v,**extrakw)
                return str(lv)
        # We have to check for FileFields and ImageFields since if you are changing
        # a form, they will already be set, and you don't need to re-upload them.
        # TODO: Find a way around skipping file and image fields
        if hasattr(field,'required') and field.required and not isinstance(field, (fields.FileField, fields.ImageField)):
            lv.add(Presence, **extrakw)
        #else:
         #   return str(lv)
        if hasattr(field, 'max_length'):
            v = getattr(field,'max_length')
            if v: lv.add(Length, maximum=v, **extrakw)
        if hasattr(field, 'min_length'):
            v = getattr(field,'min_length')
            if v: lv.add(Length, minimum=v, **extrakw)
        if not (isinstance(field, fields.EmailField) or isinstance(field, fields.URLField)) and hasattr(field, 'regex'):
            lv.add(Format, pattern=field.regex.pattern, **extrakw)
        if field.__class__ in LV_FIELDS and LV_FIELDS[field.__class__]:
            for v,kw in LV_FIELDS[field.__class__].items():
                extrakw.update(kw)
                lv.add(v, **extrakw)
                
        if str(lv):
            return """try{
%s
}catch(e){}"""%str(lv)
        return ''
dataset/ETHPy150Open callowayproject/django-livevalidation/livevalidation/templatetags/live_validation.py/ValidationNode.do_field/swapped operands of `%`