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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user