Documents: Remove old image caching model

With the creation of the new general use file Cache system
the old DocumentPageCachedImage model and manager are no longer
needed. This commit removed the model and the manager, and add
a migration to remove any data in the model before removing it
from the database.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-12-04 15:21:57 -04:00
parent 66b04296f5
commit f4e0e06c66
3 changed files with 34 additions and 51 deletions
-15
View File
@@ -34,21 +34,6 @@ class DocumentManager(models.Manager):
document.invalidate_cache()
class DocumentPageCachedImage(models.Manager):
def get_by_natural_key(self, filename, document_page_natural_key):
DocumentPage = apps.get_model(
app_label='documents', model_name='DocumentPage'
)
try:
document_page = DocumentPage.objects.get_by_natural_key(
*document_page_natural_key
)
except DocumentPage.DoesNotExist:
raise self.model.DoesNotExist
return self.get(document_page__pk=document_page.pk, filename=filename)
class DocumentPageManager(models.Manager):
def get_by_natural_key(self, page_number, document_version_natural_key):
DocumentVersion = apps.get_model(