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)
- builtins.object
- 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()