Commit graph

37 commits

Author SHA1 Message Date
Colin Wood
2f7bfe5dc7 Make sure image files has a name associated.
The generate image command will run into issues if the ImageSpecField does not
have any image file source associated wit hti. Like a Optional image field. So
we can not generate the images for that. So this should check to make sure that
it has one.
2014-07-11 10:07:43 -04:00
Jacob Magnusson
654867c3cf PEP 3110 compat 2013-06-04 21:42:03 -04:00
Matthew Tretter
301adc2087 Let's call em cachefiles
Changed my mind about 04aa72c1f9. It's
just a better description, even if different strategies can change the
behavior so it isn't really very cache-like.
2013-02-04 19:52:38 -05:00
Matthew Tretter
8e6abc1e65 Remove ensure_exists
`generate()` now plays double duty
2013-01-31 10:07:27 -05:00
Matthew Tretter
04aa72c1f9 Rename cache things (it isn't cachine)
https://twitter.com/alex_gaynor/statuses/257558176965206016
2013-01-31 10:07:20 -05:00
Matthew Tretter
54ca5da15d Improve generator id pattern matching
This behavior allows users to easy generate images by app, model, or
field.
2013-01-29 02:22:00 -05:00
Matthew Tretter
e48817a5ec Update warmimagecache to use new cacheable registry 2013-01-29 01:53:23 -05:00
Eric Eldredge
eb9089e0c8 Register cacheables as generators instead of items 2013-01-24 00:04:43 -05:00
Eric Eldredge
a8855d4c27 Change spec/source registry to generator/cacheable 2013-01-23 22:46:57 -05:00
Matthew Tretter
d80f2f26a9 "source" now refers to the file itself 2012-12-11 22:53:13 -05:00
Matthew Tretter
184c13dd4e More source_group renaming 2012-12-11 22:41:10 -05:00
Matthew Tretter
7bc82d3624 Remove arguments from generate() method
Previously, we had two places where we were passing kwargs that affected
the image generation: the ImageSpec constructor and the generate method.
These were essentially partial applications. With this commit, there's
only one partial application (when the spec is instantiated), and the
generate method is called without arguments. Therefore, specs can now
be treated as generic generators whose constructors just happen to
accept a source_file.
2012-12-01 21:20:33 -05:00
Matthew Tretter
1f06c9ac70 Remove ImageSpecCacheFile 2012-12-01 20:41:08 -05:00
Eric Eldredge
e0567e8fa7 Remove specs.SpecRegistry; add registry module
The registry module splits the work that specs.SpecRegistry
used to do into two classes: GeneratorRegistry and
SourceGroupRegistry. These two registries are wrapped in
Register and Unregister utilities for API convenience.
2012-12-01 17:16:09 -05:00
Matthew Tretter
aaa823afd6 Add flake8 linting 2012-11-05 23:34:32 -05:00
Matthew Tretter
fb8c411f75 Create new cache warming command
Replaces ikcachevalidate and ikcacheinvalidate, and uses the "sources"
abstraction. Closes #165
2012-10-24 23:41:05 -04:00
Matthew Tretter
513b23b169 Rename force flag to force-revalidation 2012-02-02 23:23:20 -05:00
Matthew Tretter
8b6ba687e4 Commands for validating and invalidating the cache 2012-02-02 00:19:46 -05:00
Matthew Tretter
a668df1c37 Spec files now accessible through _ik attr 2012-02-01 23:26:39 -05:00
Matthew Tretter
62ff07bf1f First shot at cache state backend implementation 2012-02-01 22:37:58 -05:00
Matthew Tretter
081a0a0d0f No need to check for None
`get_spec_files` will never return it.
2011-12-07 00:37:52 -05:00
Matthew Tretter
cfa3d01f54 Rename _create() to generate()
After #51 presented a good use case, we decided to make this part of
the API (i.e. remove the underscore). The default value for the `lazy`
kwarg is changed to `True` to reduce the likelihood of accidental
regeneration of images. Closes #54.
2011-11-07 23:07:09 -05:00
Bryan Veloso
06c1c678b6 PEP8-ing and whitespacing. 2011-10-31 23:12:03 +09:00
Bryan Veloso
6adadafc74 PEP8 and import tweaks. 2011-10-20 12:12:47 +09:00
Bryan Veloso
302399d837 Merge branch 'new_api' of https://github.com/matthewwithanm/django-imagekit into release/1.0.0
* 'new_api' of https://github.com/matthewwithanm/django-imagekit: (63 commits)
  fixing typo
  ImageSpecFile is a proper File
  Typo fix
  A list of ImageSpec names are now stored on the model.
  AdminThumbnailView is now AdminThumbnail
  Docs typo fix
  Adds explicit import of resize module to processors
  fixing bad import in docs
  adding name to AUTHORS
  adding test for new api
  Moved Crop and Fit to resize module.
  More docs edits.
  Typo fix.
  Installation instructions.
  Embracing duck typing.
  Documentation!
  Fix bug
  Bound fields are now cached on the model instance.
  Transpose processor now supports auto EXIF orientation.
  Fix filename formatting.
  ...

Conflicts:
	AUTHORS
	README.rst
	docs/Makefile
	docs/conf.py
	docs/index.rst
	imagekit/__init__.py
	imagekit/defaults.py
	imagekit/management/commands/ikflush.py
	imagekit/models.py
	imagekit/options.py
	imagekit/processors.py
	imagekit/specs.py
	tests/core/tests.py
2011-10-20 12:06:10 +09:00
Matthew Tretter
8147cb85df ImageSpecFile is a proper File
Previously, ImageSpecFile was a file-like object, but didn't actually
extend any of the file classes. Because of this, some of Django's file-
handling code was duplicated. More importantly, instances didn't always
behave as one might expect (if one were familiar with ImageFields),
particularly when the source image was empty. This could have been
especially confusing in templates. (For example, because
ImageSpecFields whose source images didn't exist were still truthy.)
2011-10-10 17:22:06 -04:00
Matthew Tretter
7f7141ef27 Typo fix 2011-10-10 17:21:59 -04:00
Bryan Veloso
2d4f116e57 Whitespacing and PEP8-ing. 2011-10-11 02:16:22 +09:00
Jeff Ammons
2a37d7bfdc Changed id to pk in case the primary key isn't called 'id' 2011-10-06 16:15:26 -07:00
Matthew Tretter
d6632c95f5 Documentation! 2011-09-25 21:04:11 -04:00
Matthew Tretter
3d810e7be5 Rename ImageSpecFile properties
`_obj` and `_spec` are now `instance` and `field`, to match FieldFile.
2011-09-22 18:13:32 -04:00
Matthew Tretter
bd7eb7284b BoundImageSpec is now ImageSpecFile
In preparation for unifying the ImageSpecFile and
ProcessedImageFieldFile interfaces.
2011-09-22 09:20:37 -04:00
Matthew Tretter
7167016237 Removed specs list from opts. 2011-09-21 20:21:48 -04:00
Matthew Tretter
b5616d2f75 Move ImageSpec to fields module. 2011-09-21 11:37:29 -04:00
Bryan Veloso
5d1c898283 Flush newer records first. Also, spacing. 2011-02-10 19:00:35 -08:00
Justin Driscoll
1d82a64bd7 Fixed indent and refactored ikflush command (issue #19) 2009-08-10 14:30:41 -04:00
Ariel Nunez
920bf47128 Added setup.py and relocated source dir 2009-02-02 15:46:41 -05:00