mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-05 06:10:58 +00:00
Rename source objects to source groups
This commit is contained in:
parent
49a55d4763
commit
5b1c5f7b4e
3 changed files with 5 additions and 5 deletions
|
|
@ -3,7 +3,7 @@ from .files import ProcessedImageFieldFile
|
|||
from .utils import ImageSpecFileDescriptor
|
||||
from ... import specs
|
||||
from ...specs import SpecHost
|
||||
from ...specs.sources import ImageFieldSpecSource
|
||||
from ...specs.sourcegroups import ImageFieldSourceGroup
|
||||
|
||||
|
||||
class SpecHostField(SpecHost):
|
||||
|
|
@ -44,7 +44,7 @@ class ImageSpecField(SpecHostField):
|
|||
|
||||
# Add the model and field as a source for this spec id
|
||||
specs.registry.add_sources(self.spec_id,
|
||||
[ImageFieldSpecSource(cls, self.image_field)])
|
||||
[ImageFieldSourceGroup(cls, self.image_field)])
|
||||
|
||||
|
||||
class ProcessedImageField(models.ImageField, SpecHostField):
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class SpecRegistry(object):
|
|||
raise AlreadyRegistered('The spec with id %s is already registered' % id)
|
||||
self._specs[id] = spec
|
||||
|
||||
sources = getattr(config, 'sources', None) or []
|
||||
sources = getattr(config, 'source_groups', None) or []
|
||||
self.add_sources(id, sources)
|
||||
|
||||
def unregister(self, id, spec):
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from ..signals import source_created, source_changed, source_deleted
|
|||
def ik_model_receiver(fn):
|
||||
"""
|
||||
A method decorator that filters out signals coming from models that don't
|
||||
have fields that function as ImageFieldSpecSources
|
||||
have fields that function as ImageFieldSourceGroup
|
||||
|
||||
"""
|
||||
@wraps(fn)
|
||||
|
|
@ -97,7 +97,7 @@ class ModelSignalRouter(object):
|
|||
signal.send(sender=source, source_file=file, info=info)
|
||||
|
||||
|
||||
class ImageFieldSpecSource(object):
|
||||
class ImageFieldSourceGroup(object):
|
||||
def __init__(self, model_class, image_field):
|
||||
"""
|
||||
Good design would dictate that this instance would be responsible for
|
||||
Loading…
Reference in a new issue