diff --git a/mayan/apps/sources/forms.py b/mayan/apps/sources/forms.py index f28a7f7984..83cb9f9ce9 100644 --- a/mayan/apps/sources/forms.py +++ b/mayan/apps/sources/forms.py @@ -76,25 +76,11 @@ class WebFormForm(DocumentForm): class WebFormSetupForm(forms.ModelForm): - def __init__(self, *args, **kwargs): - super(WebFormSetupForm, self).__init__(*args, **kwargs) - self.fields['icon'].widget = FamFamRadioSelect( - attrs=self.fields['icon'].widget.attrs, - choices=self.fields['icon'].widget.choices, - ) - class Meta: model = WebForm class StagingFolderSetupForm(forms.ModelForm): - def __init__(self, *args, **kwargs): - super(StagingFolderSetupForm, self).__init__(*args, **kwargs) - self.fields['icon'].widget = FamFamRadioSelect( - attrs=self.fields['icon'].widget.attrs, - choices=self.fields['icon'].widget.choices, - ) - class Meta: model = StagingFolder diff --git a/mayan/apps/sources/literals.py b/mayan/apps/sources/literals.py index bed00d02fd..260c9160e4 100644 --- a/mayan/apps/sources/literals.py +++ b/mayan/apps/sources/literals.py @@ -15,30 +15,6 @@ SOURCE_INTERACTIVE_UNCOMPRESS_CHOICES = ( (SOURCE_UNCOMPRESS_CHOICE_ASK, _(u'Ask user')) ) -SOURCE_ICON_DISK = 'disk' -SOURCE_ICON_DATABASE = 'database' -SOURCE_ICON_DRIVE = 'drive' -SOURCE_ICON_DRIVE_NETWORK = 'drive_network' -SOURCE_ICON_DRIVE_USER = 'drive_user' -SOURCE_ICON_EMAIL = 'email' -SOURCE_ICON_FOLDER = 'folder' -SOURCE_ICON_WORLD = 'world' -SOURCE_ICON_PRINTER = 'printer' -SOURCE_ICON_PRINTER_EMPTY = 'printer_empty' - -SOURCE_ICON_CHOICES = ( - (SOURCE_ICON_DISK, _(u'Disk')), - (SOURCE_ICON_DATABASE, _(u'Database')), - (SOURCE_ICON_DRIVE, _(u'Drive')), - (SOURCE_ICON_DRIVE_NETWORK, _(u'Network drive')), - (SOURCE_ICON_DRIVE_USER, _(u'User drive')), - (SOURCE_ICON_EMAIL, _(u'Envelope')), - (SOURCE_ICON_FOLDER, _(u'Folder')), - (SOURCE_ICON_WORLD, _(u'World')), - (SOURCE_ICON_PRINTER, _(u'Printer')), - (SOURCE_ICON_PRINTER_EMPTY, _(u'Empty printer')), -) - SOURCE_CHOICE_WEB_FORM = 'webform' SOURCE_CHOICE_STAGING = 'staging' SOURCE_CHOICE_WATCH = 'watch' diff --git a/mayan/apps/sources/migrations/0003_auto__del_field_stagingfolder_icon__del_field_webform_icon.py b/mayan/apps/sources/migrations/0003_auto__del_field_stagingfolder_icon__del_field_webform_icon.py new file mode 100644 index 0000000000..64a48c8059 --- /dev/null +++ b/mayan/apps/sources/migrations/0003_auto__del_field_stagingfolder_icon__del_field_webform_icon.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Deleting field 'StagingFolder.icon' + db.delete_column(u'sources_stagingfolder', 'icon') + + # Deleting field 'WebForm.icon' + db.delete_column(u'sources_webform', 'icon') + + + def backwards(self, orm): + # Adding field 'StagingFolder.icon' + db.add_column(u'sources_stagingfolder', 'icon', + self.gf('django.db.models.fields.CharField')(max_length=24, null=True, blank=True), + keep_default=False) + + # Adding field 'WebForm.icon' + db.add_column(u'sources_webform', 'icon', + self.gf('django.db.models.fields.CharField')(max_length=24, null=True, blank=True), + keep_default=False) + + + models = { + u'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + u'sources.outofprocess': { + 'Meta': {'ordering': "('title',)", 'object_name': 'OutOfProcess'}, + 'blacklist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + u'sources.sourcetransformation': { + 'Meta': {'ordering': "('order',)", 'object_name': 'SourceTransformation'}, + 'arguments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'transformation': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + u'sources.stagingfolder': { + 'Meta': {'ordering': "('title',)", 'object_name': 'StagingFolder'}, + 'blacklist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'delete_after_upload': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'folder_path': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'preview_height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'preview_width': ('django.db.models.fields.IntegerField', [], {}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'uncompress': ('django.db.models.fields.CharField', [], {'max_length': '1'}), + 'whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + u'sources.watchfolder': { + 'Meta': {'ordering': "('title',)", 'object_name': 'WatchFolder'}, + 'blacklist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'delete_after_upload': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'folder_path': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'interval': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'uncompress': ('django.db.models.fields.CharField', [], {'max_length': '1'}), + 'whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + u'sources.webform': { + 'Meta': {'ordering': "('title',)", 'object_name': 'WebForm'}, + 'blacklist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'uncompress': ('django.db.models.fields.CharField', [], {'max_length': '1'}), + 'whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + } + } + + complete_apps = ['sources'] \ No newline at end of file diff --git a/mayan/apps/sources/models.py b/mayan/apps/sources/models.py index 428249fef3..3033ced6d9 100644 --- a/mayan/apps/sources/models.py +++ b/mayan/apps/sources/models.py @@ -23,10 +23,10 @@ from scheduler.api import register_interval_job, remove_job from .classes import StagingFile from .literals import (SOURCE_CHOICES, SOURCE_CHOICES_PLURAL, - SOURCE_INTERACTIVE_UNCOMPRESS_CHOICES, SOURCE_CHOICE_WEB_FORM, - SOURCE_CHOICE_STAGING, SOURCE_ICON_DISK, SOURCE_ICON_DRIVE, - SOURCE_ICON_CHOICES, SOURCE_CHOICE_WATCH, SOURCE_UNCOMPRESS_CHOICES, - SOURCE_UNCOMPRESS_CHOICE_Y) + SOURCE_CHOICE_STAGING, SOURCE_CHOICE_WATCH, + SOURCE_CHOICE_WEB_FORM, + SOURCE_INTERACTIVE_UNCOMPRESS_CHOICES, + SOURCE_UNCOMPRESS_CHOICES, SOURCE_UNCOMPRESS_CHOICE_Y) from .managers import SourceTransformationManager logger = logging.getLogger(__name__) @@ -141,13 +141,6 @@ class BaseModel(models.Model): class InteractiveBaseModel(BaseModel): - icon = models.CharField(blank=True, null=True, max_length=24, choices=SOURCE_ICON_CHOICES, verbose_name=_(u'Icon'), help_text=_(u'An icon to visually distinguish this source.')) - - def save(self, *args, **kwargs): - if not self.icon: - self.icon = self.default_icon - super(BaseModel, self).save(*args, **kwargs) - class Meta(BaseModel.Meta): abstract = True @@ -155,7 +148,6 @@ class InteractiveBaseModel(BaseModel): class StagingFolder(InteractiveBaseModel): is_interactive = True source_type = SOURCE_CHOICE_STAGING - default_icon = SOURCE_ICON_DRIVE folder_path = models.CharField(max_length=255, verbose_name=_(u'Folder path'), help_text=_(u'Server side filesystem path.')) preview_width = models.IntegerField(verbose_name=_(u'Preview width'), help_text=_(u'Width value to be passed to the converter backend.')) @@ -189,7 +181,6 @@ class StagingFolder(InteractiveBaseModel): class WebForm(InteractiveBaseModel): is_interactive = True source_type = SOURCE_CHOICE_WEB_FORM - default_icon = SOURCE_ICON_DISK uncompress = models.CharField(max_length=1, choices=SOURCE_INTERACTIVE_UNCOMPRESS_CHOICES, verbose_name=_(u'Uncompress'), help_text=_(u'Whether to expand or not compressed archives.')) # Default path diff --git a/mayan/apps/sources/views.py b/mayan/apps/sources/views.py index 88e6de3a8a..e010916d45 100644 --- a/mayan/apps/sources/views.py +++ b/mayan/apps/sources/views.py @@ -67,7 +67,6 @@ def get_tab_link_for_source(source, document=None): 'text': source.title, 'view': view, 'args': args, - 'famfam': source.icon, 'keep_query': True, 'conditional_highlight': return_function(source), }