From fc01c84bad5b453141aa04a53bc3bc4ed00015ea Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 25 Mar 2016 18:49:45 -0400 Subject: [PATCH] Avoided need to import model fields in models/functions.py. --- django/db/models/functions.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/django/db/models/functions.py b/django/db/models/functions.py index 4abb9a178b..8aecc99633 100644 --- a/django/db/models/functions.py +++ b/django/db/models/functions.py @@ -1,9 +1,7 @@ """ Classes that represent database functions. """ -from django.db.models import ( - DateTimeField, Func, IntegerField, Transform, Value, -) +from django.db.models import Func, Transform, Value, fields class Coalesce(Func): @@ -136,7 +134,7 @@ class Length(Transform): lookup_name = 'length' def __init__(self, expression, **extra): - output_field = extra.pop('output_field', IntegerField()) + output_field = extra.pop('output_field', fields.IntegerField()) super(Length, self).__init__(expression, output_field=output_field, **extra) def as_mysql(self, compiler, connection): @@ -153,7 +151,7 @@ class Now(Func): def __init__(self, output_field=None, **extra): if output_field is None: - output_field = DateTimeField() + output_field = fields.DateTimeField() super(Now, self).__init__(output_field=output_field, **extra) def as_postgresql(self, compiler, connection):