diff --git a/scielomanager/journalmanager/migrations/0033_update_issue_label.py b/scielomanager/journalmanager/migrations/0033_update_issue_label.py new file mode 100644 index 00000000..a4425975 --- /dev/null +++ b/scielomanager/journalmanager/migrations/0033_update_issue_label.py @@ -0,0 +1,401 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import DataMigration +from django.db import models + +class Migration(DataMigration): + + def forwards(self, orm): + "Write your forwards methods here." + # Note: Don't use "from appname.models import ModelName". + # Use orm.ModelName to refer to models in this application, + # and orm['appname.ModelName'] for models in other applications. + for spe_issue in orm.Issue.objects.filter(type='special'): + spe_issue.label = unicode(spe_issue) + spe_issue.save() + + def backwards(self, orm): + "Write your backwards methods here." + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + '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'}), + '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'}) + }, + 'journalmanager.aheadpressrelease': { + 'Meta': {'object_name': 'AheadPressRelease', '_ormbases': ['journalmanager.PressRelease']}, + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'press_releases'", 'to': "orm['journalmanager.Journal']"}), + 'pressrelease_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['journalmanager.PressRelease']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'journalmanager.article': { + 'Meta': {'object_name': 'Article'}, + 'aid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), + 'article_type': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), + 'doi': ('django.db.models.fields.CharField', [], {'default': "u''", 'max_length': '2048', 'db_index': 'True'}), + 'domain_key': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '2048', 'db_index': 'False'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_aop': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'issn_epub': ('django.db.models.fields.CharField', [], {'max_length': '9', 'db_index': 'True'}), + 'issn_ppub': ('django.db.models.fields.CharField', [], {'max_length': '9', 'db_index': 'True'}), + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'articles'", 'null': 'True', 'to': "orm['journalmanager.Issue']"}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'articles'", 'null': 'True', 'to': "orm['journalmanager.Journal']"}), + 'journal_title': ('django.db.models.fields.CharField', [], {'max_length': '512', 'db_index': 'True'}), + 'related_articles': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['journalmanager.Article']", 'null': 'True', 'through': "orm['journalmanager.ArticlesLinkage']", 'blank': 'True'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), + 'xml': ('scielomanager.custom_fields.XMLSPSField', [], {}), + 'xml_version': ('django.db.models.fields.CharField', [], {'max_length': '9'}) + }, + 'journalmanager.articleasset': { + 'Meta': {'object_name': 'ArticleAsset'}, + 'article': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'assets'", 'to': "orm['journalmanager.Article']"}), + 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '1024'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'default': "u''", 'max_length': '1024'}), + 'preferred_alt_file': ('django.db.models.fields.files.FileField', [], {'default': "u''", 'max_length': '1024'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'use_license': ('django.db.models.fields.TextField', [], {'default': "u''"}) + }, + 'journalmanager.articlecontrolattributes': { + 'Meta': {'object_name': 'ArticleControlAttributes'}, + 'article': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'control_attributes'", 'unique': 'True', 'to': "orm['journalmanager.Article']"}), + 'articles_linkage_is_pending': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'es_is_dirty': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'es_updated_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + }, + 'journalmanager.articlehtmlrendition': { + 'Meta': {'unique_together': "(('article', 'lang'),)", 'object_name': 'ArticleHTMLRendition'}, + 'article': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'htmls'", 'to': "orm['journalmanager.Article']"}), + 'build_version': ('django.db.models.fields.CharField', [], {'max_length': '8'}), + 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '1024'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lang': ('django.db.models.fields.CharField', [], {'max_length': '2'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) + }, + 'journalmanager.articleslinkage': { + 'Meta': {'object_name': 'ArticlesLinkage'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'link_to': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'referrers'", 'to': "orm['journalmanager.Article']"}), + 'link_type': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'referrer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'links_to'", 'to': "orm['journalmanager.Article']"}) + }, + 'journalmanager.collection': { + 'Meta': {'ordering': "['name']", 'object_name': 'Collection'}, + 'acronym': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), + 'address': ('django.db.models.fields.TextField', [], {}), + 'address_complement': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), + 'address_number': ('django.db.models.fields.CharField', [], {'max_length': '8'}), + 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), + 'collection': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'user_collection'", 'to': "orm['auth.User']", 'through': "orm['journalmanager.UserCollections']", 'blank': 'True', 'symmetrical': 'False', 'null': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'fax': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'name_slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}), + 'zip_code': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}) + }, + 'journalmanager.institution': { + 'Meta': {'ordering': "['name']", 'object_name': 'Institution'}, + 'acronym': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), + 'address': ('django.db.models.fields.TextField', [], {}), + 'address_complement': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), + 'address_number': ('django.db.models.fields.CharField', [], {'max_length': '8'}), + 'cel': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), + 'complement': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'fax': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_trashed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), + 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'zip_code': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}) + }, + 'journalmanager.issue': { + 'Meta': {'ordering': "('created', 'id')", 'object_name': 'Issue'}, + 'cover': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'ctrl_vocabulary': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), + 'editorial_standard': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_marked_up': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_trashed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Journal']"}), + 'label': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'null': 'True', 'blank': 'True'}), + 'number': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'blank': 'True'}), + 'publication_end_month': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'publication_start_month': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'publication_year': ('django.db.models.fields.IntegerField', [], {}), + 'section': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['journalmanager.Section']", 'symmetrical': 'False', 'blank': 'True'}), + 'spe_text': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), + 'suppl_text': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), + 'total_documents': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'type': ('django.db.models.fields.CharField', [], {'default': "'regular'", 'max_length': '15'}), + 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'use_license': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.UseLicense']", 'null': 'True'}), + 'volume': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}) + }, + 'journalmanager.issuetitle': { + 'Meta': {'object_name': 'IssueTitle'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Issue']"}), + 'language': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Language']"}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '256'}) + }, + 'journalmanager.journal': { + 'Meta': {'ordering': "('title', 'id')", 'object_name': 'Journal'}, + 'abstract_keyword_languages': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'abstract_keyword_languages'", 'symmetrical': 'False', 'to': "orm['journalmanager.Language']"}), + 'acronym': ('django.db.models.fields.CharField', [], {'max_length': '16'}), + 'ccn_code': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'blank': 'True'}), + 'collections': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['journalmanager.Collection']", 'through': "orm['journalmanager.Membership']", 'symmetrical': 'False'}), + 'copyrighter': ('django.db.models.fields.CharField', [], {'max_length': '254'}), + 'cover': ('scielomanager.custom_fields.ContentTypeRestrictedFileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'enjoy_creator'", 'to': "orm['auth.User']"}), + 'ctrl_vocabulary': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'current_ahead_documents': ('django.db.models.fields.IntegerField', [], {'default': '0', 'max_length': '3', 'blank': 'True'}), + 'editor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'editor_journal'", 'null': 'True', 'to': "orm['auth.User']"}), + 'editor_address': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'editor_address_city': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'editor_address_country': ('scielo_extensions.modelfields.CountryField', [], {'max_length': '2'}), + 'editor_address_state': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'editor_address_zip': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'editor_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'editor_name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'editor_phone1': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'editor_phone2': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}), + 'editorial_standard': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'eletronic_issn': ('django.db.models.fields.CharField', [], {'max_length': '9', 'db_index': 'True'}), + 'final_num': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '16', 'blank': 'True'}), + 'final_vol': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '16', 'blank': 'True'}), + 'final_year': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '4', 'blank': 'True'}), + 'frequency': ('django.db.models.fields.CharField', [], {'max_length': '16'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index_coverage': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), + 'init_num': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '16', 'blank': 'True'}), + 'init_vol': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '16', 'blank': 'True'}), + 'init_year': ('django.db.models.fields.CharField', [], {'max_length': '4'}), + 'is_indexed_aehci': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_indexed_scie': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_indexed_ssci': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_trashed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['journalmanager.Language']", 'symmetrical': 'False'}), + 'logo': ('scielomanager.custom_fields.ContentTypeRestrictedFileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'medline_code': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'blank': 'True'}), + 'medline_title': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'notes': ('django.db.models.fields.TextField', [], {'default': "''", 'max_length': '254', 'blank': 'True'}), + 'other_previous_title': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), + 'previous_ahead_documents': ('django.db.models.fields.IntegerField', [], {'default': '0', 'max_length': '3', 'blank': 'True'}), + 'previous_title': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'prev_title'", 'null': 'True', 'to': "orm['journalmanager.Journal']"}), + 'print_issn': ('django.db.models.fields.CharField', [], {'max_length': '9', 'db_index': 'True'}), + 'pub_level': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'publication_city': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'publisher_country': ('scielo_extensions.modelfields.CountryField', [], {'max_length': '2'}), + 'publisher_name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'publisher_state': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'scielo_issn': ('django.db.models.fields.CharField', [], {'max_length': '16'}), + 'secs_code': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'blank': 'True'}), + 'short_title': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'db_index': 'True'}), + 'sponsor': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'journal_sponsor'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['journalmanager.Sponsor']"}), + 'study_areas': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'journals_migration_tmp'", 'null': 'True', 'to': "orm['journalmanager.StudyArea']"}), + 'subject_categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'journals'", 'null': 'True', 'to': "orm['journalmanager.SubjectCategory']"}), + 'subject_descriptors': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}), + 'title_iso': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}), + 'twitter_user': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), + 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'url_journal': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), + 'url_online_submission': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), + 'use_license': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.UseLicense']"}) + }, + 'journalmanager.journalmission': { + 'Meta': {'object_name': 'JournalMission'}, + 'description': ('django.db.models.fields.TextField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'missions'", 'to': "orm['journalmanager.Journal']"}), + 'language': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Language']", 'null': 'True'}) + }, + 'journalmanager.journaltimeline': { + 'Meta': {'object_name': 'JournalTimeline'}, + 'collection': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Collection']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['journalmanager.Journal']"}), + 'reason': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'since': ('django.db.models.fields.DateTimeField', [], {}), + 'status': ('django.db.models.fields.CharField', [], {'max_length': '16'}) + }, + 'journalmanager.journaltitle': { + 'Meta': {'object_name': 'JournalTitle'}, + 'category': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'other_titles'", 'to': "orm['journalmanager.Journal']"}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'journalmanager.language': { + 'Meta': {'ordering': "['name']", 'object_name': 'Language'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'iso_code': ('django.db.models.fields.CharField', [], {'max_length': '2'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}) + }, + 'journalmanager.membership': { + 'Meta': {'unique_together': "(('journal', 'collection'),)", 'object_name': 'Membership'}, + 'collection': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Collection']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Journal']"}), + 'reason': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), + 'since': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'status': ('django.db.models.fields.CharField', [], {'default': "'inprogress'", 'max_length': '16'}) + }, + 'journalmanager.pendedform': { + 'Meta': {'object_name': 'PendedForm'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'form_hash': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pending_forms'", 'to': "orm['auth.User']"}), + 'view_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'journalmanager.pendedvalue': { + 'Meta': {'object_name': 'PendedValue'}, + 'form': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'data'", 'to': "orm['journalmanager.PendedForm']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'value': ('django.db.models.fields.TextField', [], {}) + }, + 'journalmanager.pressrelease': { + 'Meta': {'object_name': 'PressRelease'}, + 'doi': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + }, + 'journalmanager.pressreleasearticle': { + 'Meta': {'object_name': 'PressReleaseArticle'}, + 'article_pid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'press_release': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'articles'", 'to': "orm['journalmanager.PressRelease']"}) + }, + 'journalmanager.pressreleasetranslation': { + 'Meta': {'object_name': 'PressReleaseTranslation'}, + 'content': ('django.db.models.fields.TextField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Language']"}), + 'press_release': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'to': "orm['journalmanager.PressRelease']"}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'journalmanager.regularpressrelease': { + 'Meta': {'object_name': 'RegularPressRelease', '_ormbases': ['journalmanager.PressRelease']}, + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'press_releases'", 'to': "orm['journalmanager.Issue']"}), + 'pressrelease_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['journalmanager.PressRelease']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'journalmanager.section': { + 'Meta': {'ordering': "('id',)", 'object_name': 'Section'}, + 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '21', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_trashed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Journal']"}), + 'legacy_code': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}), + 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) + }, + 'journalmanager.sectiontitle': { + 'Meta': {'ordering': "['title']", 'object_name': 'SectionTitle'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Language']"}), + 'section': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'titles'", 'to': "orm['journalmanager.Section']"}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '256'}) + }, + 'journalmanager.sponsor': { + 'Meta': {'ordering': "['name']", 'object_name': 'Sponsor', '_ormbases': ['journalmanager.Institution']}, + 'collections': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['journalmanager.Collection']", 'symmetrical': 'False'}), + 'institution_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['journalmanager.Institution']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'journalmanager.studyarea': { + 'Meta': {'object_name': 'StudyArea'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'study_area': ('django.db.models.fields.CharField', [], {'max_length': '256'}) + }, + 'journalmanager.subjectcategory': { + 'Meta': {'object_name': 'SubjectCategory'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'term': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}) + }, + 'journalmanager.translateddata': { + 'Meta': {'object_name': 'TranslatedData'}, + 'field': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'translation': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + 'journalmanager.uselicense': { + 'Meta': {'ordering': "['license_code']", 'object_name': 'UseLicense'}, + 'disclaimer': ('django.db.models.fields.TextField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'license_code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'reference_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) + }, + 'journalmanager.usercollections': { + 'Meta': {'unique_together': "(('user', 'collection'),)", 'object_name': 'UserCollections'}, + 'collection': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Collection']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_manager': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'journalmanager.userprofile': { + 'Meta': {'object_name': 'UserProfile'}, + 'email_notifications': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'tz': ('django.db.models.fields.CharField', [], {'default': "'America/Sao_Paulo'", 'max_length': '150'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) + } + } + + complete_apps = ['journalmanager'] + symmetrical = True diff --git a/scielomanager/journalmanager/models.py b/scielomanager/journalmanager/models.py index 514ba07a..44792312 100644 --- a/scielomanager/journalmanager/models.py +++ b/scielomanager/journalmanager/models.py @@ -997,7 +997,8 @@ def identification(self): values.append('suppl.%s' % self.suppl_text) if self.type == 'special': - values.append('spe.%s' % self.spe_text) + _spe_text = 'spe' + self.spe_text if self.spe_text else 'spe' + values.append(_spe_text) return ' '.join([val for val in values if val]).strip().replace('ahead', 'ahead of print') diff --git a/scielomanager/journalmanager/tests/tests_models.py b/scielomanager/journalmanager/tests/tests_models.py index d4c2a63c..513b6fb0 100644 --- a/scielomanager/journalmanager/tests/tests_models.py +++ b/scielomanager/journalmanager/tests/tests_models.py @@ -158,7 +158,7 @@ def test_identification_for_ahead(self): def test_identification_for_special(self): issue = IssueFactory.create(number='1', spe_text='2', type='special') - expected = u'1 spe.2' + expected = u'1 spe2' self.assertEqual(issue.identification, expected)