mirror of
https://github.com/django/django.git
synced 2025-07-19 03:05:32 +00:00
Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for the work on the patch and Alex for reviewing.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
956da729d1
commit
24f4764a48
242 changed files with 308 additions and 485 deletions
|
@ -1,18 +1,14 @@
|
|||
import datetime
|
||||
import os
|
||||
|
||||
from django.conf import settings
|
||||
from django import forms
|
||||
from django.db.models.fields import Field
|
||||
from django.core.files.base import File, ContentFile
|
||||
from django.core.files.base import File
|
||||
from django.core.files.storage import default_storage
|
||||
from django.core.files.images import ImageFile, get_image_dimensions
|
||||
from django.core.files.uploadedfile import UploadedFile
|
||||
from django.utils.functional import curry
|
||||
from django.core.files.images import ImageFile
|
||||
from django.db.models import signals
|
||||
from django.utils.encoding import force_unicode, smart_str
|
||||
from django.utils.translation import ugettext_lazy, ugettext as _
|
||||
from django import forms
|
||||
from django.db.models.loading import cache
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
class FieldFile(File):
|
||||
def __init__(self, instance, field, name):
|
||||
|
@ -215,7 +211,7 @@ class FileField(Field):
|
|||
# The descriptor to use for accessing the attribute off of the class.
|
||||
descriptor_class = FileDescriptor
|
||||
|
||||
description = ugettext_lazy("File path")
|
||||
description = _("File path")
|
||||
|
||||
def __init__(self, verbose_name=None, name=None, upload_to='', storage=None, **kwargs):
|
||||
for arg in ('primary_key', 'unique'):
|
||||
|
@ -312,6 +308,7 @@ class ImageFileDescriptor(FileDescriptor):
|
|||
self.field.update_dimension_fields(instance, force=True)
|
||||
|
||||
class ImageFieldFile(ImageFile, FieldFile):
|
||||
|
||||
def delete(self, save=True):
|
||||
# Clear the image dimensions cache
|
||||
if hasattr(self, '_dimensions_cache'):
|
||||
|
@ -321,7 +318,7 @@ class ImageFieldFile(ImageFile, FieldFile):
|
|||
class ImageField(FileField):
|
||||
attr_class = ImageFieldFile
|
||||
descriptor_class = ImageFileDescriptor
|
||||
description = ugettext_lazy("File path")
|
||||
description = _("File path")
|
||||
|
||||
def __init__(self, verbose_name=None, name=None, width_field=None, height_field=None, **kwargs):
|
||||
self.width_field, self.height_field = width_field, height_field
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue