Initial commit of the converter image transformation refactor
This commit is contained in:
@@ -6,7 +6,8 @@ from django.contrib.contenttypes import generic
|
||||
from documents.models import DocumentType
|
||||
from documents.managers import RecentDocumentManager
|
||||
from metadata.models import MetadataType
|
||||
from converter.api import backend
|
||||
from converter.api import get_available_transformations_choices
|
||||
from converter.literals import DIMENSION_SEPARATOR
|
||||
|
||||
from sources.managers import SourceTransformationManager
|
||||
|
||||
@@ -118,7 +119,7 @@ class StagingFolder(InteractiveBaseModel):
|
||||
if self.preview_height:
|
||||
dimensions.append(unicode(self.preview_height))
|
||||
|
||||
return u'x'.join(dimensions)
|
||||
return DIMENSION_SEPARATOR.join(dimensions)
|
||||
|
||||
class Meta(InteractiveBaseModel.Meta):
|
||||
verbose_name = _(u'staging folder')
|
||||
@@ -162,8 +163,8 @@ class SourceTransformation(models.Model):
|
||||
object_id = models.PositiveIntegerField()
|
||||
content_object = generic.GenericForeignKey('content_type', 'object_id')
|
||||
order = models.PositiveIntegerField(default=0, blank=True, null=True, verbose_name=_(u'order'), db_index=True)
|
||||
transformation = models.CharField(choices=backend.get_available_transformations_labels(), max_length=128, verbose_name=_(u'transformation'))
|
||||
arguments = models.TextField(blank=True, null=True, verbose_name=_(u'arguments'), help_text=_(u'Use dictionaries to indentify arguments, example: {\'degrees\':90}'))
|
||||
transformation = models.CharField(choices=get_available_transformations_choices(), max_length=128, verbose_name=_(u'transformation'))
|
||||
arguments = models.TextField(blank=True, null=True, verbose_name=_(u'arguments'), help_text=_(u'Use dictionaries to indentify arguments, example: %s') % u'{\'degrees\':90}')
|
||||
|
||||
objects = SourceTransformationManager()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user