Merge pull request #36 from jammons/develop

Changed id to pk in case the primary key isn't called 'id'
This commit is contained in:
Bryan Veloso 2011-10-10 00:37:18 -07:00
commit 00049abc95

View file

@ -25,7 +25,7 @@ def flush_cache(apps, options):
models = [m for m in cache.get_models(app) if issubclass(m, ImageModel)]
for model in models:
print 'Flushing cache for "%s.%s"' % (app_label, model.__name__)
for obj in model.objects.order_by('-id'):
for obj in model.objects.order_by('-pk'):
for spec in model._ik.specs:
prop = getattr(obj, spec.name(), None)
if prop is not None: