class IntegerFieldFloatRounding

from django.db.models.lookups import IntegerFieldFloatRounding
Allow floats to work as query values for IntegerField. Without this, the
decimal portion of the float would always be discarded.

Ancestors (MRO)

  1. builtins.object
  2. django.db.models.lookups.IntegerFieldFloatRounding
def get_prep_lookup(self)
django.db.models.lookups.IntegerFieldFloatRounding
    def get_prep_lookup(self):
        if isinstance(self.rhs, float):
            self.rhs = math.ceil(self.rhs)
        return super().get_prep_lookup()