mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[py3] Fixed F-expression division operators
In Python 3 dividing by int will call obj.__truediv__(). This operator was missing from F-expressions.
This commit is contained in:
		| @@ -58,8 +58,9 @@ class ExpressionNode(tree.Node): | |||||||
|     def __mul__(self, other): |     def __mul__(self, other): | ||||||
|         return self._combine(other, self.MUL, False) |         return self._combine(other, self.MUL, False) | ||||||
|  |  | ||||||
|     def __div__(self, other): |     def __truediv__(self, other): | ||||||
|         return self._combine(other, self.DIV, False) |         return self._combine(other, self.DIV, False) | ||||||
|  |     __div__ = __truediv__ # Python 2 compatibility | ||||||
|  |  | ||||||
|     def __mod__(self, other): |     def __mod__(self, other): | ||||||
|         return self._combine(other, self.MOD, False) |         return self._combine(other, self.MOD, False) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user