# HG changeset patch # User ymh # Date 1372167258 -7200 # Node ID 8598629399967389be4cd51a00dd65e51639613f # Parent b1fd0e0197c8cf9d66cda09712b152112b251caf add qualifier on the wikipedia link diff -r b1fd0e0197c8 -r 859862939996 .settings/org.eclipse.core.resources.prefs --- a/.settings/org.eclipse.core.resources.prefs Tue Jun 25 10:28:25 2013 +0200 +++ b/.settings/org.eclipse.core.resources.prefs Tue Jun 25 15:34:18 2013 +0200 @@ -1,11 +1,13 @@ eclipse.preferences.version=1 encoding//src/core/import_processor.py=utf-8 +encoding//src/core/migrations/0005_set_semantic_link_level.py=utf-8 encoding//src/core/models/notice.py=utf-8 encoding//src/core/models/term.py=utf-8 encoding//src/core/rdf_models.py=utf-8 encoding//src/core/settings.py=utf-8 encoding//src/core/templatetags/core_extras.py=utf-8 encoding//src/core/templatetags/utils.py=utf-8 +encoding//src/core/utils.py=utf-8 encoding//src/core/wp_utils.py=utf-8 encoding//src/jocondelab/config.py=utf-8 encoding//src/jocondelab/forms.py=utf-8 @@ -13,7 +15,6 @@ encoding//src/jocondelab/management/commands/import_skos.py=utf-8 encoding//src/jocondelab/management/commands/import_term_labels.py=utf-8 encoding//src/jocondelab/management/commands/import_terms.py=utf-8 -encoding//src/jocondelab/management/utils.py=utf-8 encoding//src/jocondelab/models.py=utf-8 encoding//src/jocondelab/utils.py=utf-8 encoding//src/jocondelab/views.py=utf-8 diff -r b1fd0e0197c8 -r 859862939996 src/core/locale/en/LC_MESSAGES/django.mo Binary file src/core/locale/en/LC_MESSAGES/django.mo has changed diff -r b1fd0e0197c8 -r 859862939996 src/core/locale/en/LC_MESSAGES/django.po --- a/src/core/locale/en/LC_MESSAGES/django.po Tue Jun 25 10:28:25 2013 +0200 +++ b/src/core/locale/en/LC_MESSAGES/django.po Tue Jun 25 15:34:18 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-06-24 23:51+0200\n" +"POT-Creation-Date: 2013-06-25 14:08+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -35,3 +35,23 @@ #: models/term.py:32 msgid "unsematized" msgstr "no semantics" + +#: models/term.py:52 +msgid "--" +msgstr "--" + +#: models/term.py:53 +msgid "EE" +msgstr "EE: exact equivalence" + +#: models/term.py:54 +msgid "EI" +msgstr "EI: inaccurate equivalence" + +#: models/term.py:55 +msgid "BM" +msgstr "BM: equivalence to a broader concept" + +#: models/term.py:56 +msgid "NM" +msgstr "NM: equivalence to a narrower concept" diff -r b1fd0e0197c8 -r 859862939996 src/core/locale/fr/LC_MESSAGES/django.mo Binary file src/core/locale/fr/LC_MESSAGES/django.mo has changed diff -r b1fd0e0197c8 -r 859862939996 src/core/locale/fr/LC_MESSAGES/django.po --- a/src/core/locale/fr/LC_MESSAGES/django.po Tue Jun 25 10:28:25 2013 +0200 +++ b/src/core/locale/fr/LC_MESSAGES/django.po Tue Jun 25 15:34:18 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-06-24 23:51+0200\n" +"POT-Creation-Date: 2013-06-25 14:08+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -36,3 +36,23 @@ #: models/term.py:32 msgid "unsematized" msgstr "Non sémantisé" + +#: models/term.py:52 +msgid "--" +msgstr "--" + +#: models/term.py:53 +msgid "EE" +msgstr "EE : équivalence exacte" + +#: models/term.py:54 +msgid "EI" +msgstr "EI : équivalence inexacte" + +#: models/term.py:55 +msgid "BM" +msgstr "BM : équivalence vers un concept plus vaste" + +#: models/term.py:56 +msgid "NM" +msgstr "NM : équivalence vers un concept moins vaste" diff -r b1fd0e0197c8 -r 859862939996 src/core/migrations/0004_auto__add_field_term_link_semantic_level.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/core/migrations/0004_auto__add_field_term_link_semantic_level.py Tue Jun 25 15:34:18 2013 +0200 @@ -0,0 +1,227 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'Term.link_semantic_level' + db.add_column(u'core_term', 'link_semantic_level', + self.gf('django.db.models.fields.IntegerField')(default=None, null=True, db_index=True, blank=True), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Term.link_semantic_level' + db.delete_column(u'core_term', 'link_semantic_level') + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 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'}) + }, + 'core.autrnoticeterm': { + 'Meta': {'object_name': 'AutrNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.domnnoticeterm': { + 'Meta': {'object_name': 'DomnNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.ecolnoticeterm': { + 'Meta': {'object_name': 'EcolNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.epoqnoticeterm': { + 'Meta': {'object_name': 'EpoqNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.lieuxnoticeterm': { + 'Meta': {'object_name': 'LieuxNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.notice': { + 'Meta': {'object_name': 'Notice'}, + 'adpt': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'appl': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'aptn': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'attr': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'autr': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'autr_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'autr+'", 'symmetrical': 'False', 'through': "orm['core.AutrNoticeTerm']", 'to': "orm['core.Term']"}), + 'bibl': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'comm': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'contact': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'coor': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'copy': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'dacq': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'data': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'dation': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'ddpt': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'decv': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'deno': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'depo': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'desc': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'desy': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'dims': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'dmaj': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'dmis': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'domn': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'domn_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'domn+'", 'symmetrical': 'False', 'through': "orm['core.DomnNoticeTerm']", 'to': "orm['core.Term']"}), + 'drep': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'ecol': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'ecol_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'ecol+'", 'symmetrical': 'False', 'through': "orm['core.EcolNoticeTerm']", 'to': "orm['core.Term']"}), + 'epoq': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'epoq_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'epoq+'", 'symmetrical': 'False', 'through': "orm['core.EpoqNoticeTerm']", 'to': "orm['core.Term']"}), + 'etat': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'expo': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'gene': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'geohi': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'hist': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'insc': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'inv': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'labo': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'lieux': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'lieux_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'lieux+'", 'symmetrical': 'False', 'through': "orm['core.LieuxNoticeTerm']", 'to': "orm['core.Term']"}), + 'loca': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'loca2': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'mill': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'milu': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'mosa': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'msgcom': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'museo': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'nsda': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'onom': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'paut': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'pdat': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'pdec': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'peoc': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'peri': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'peri_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'peri+'", 'symmetrical': 'False', 'through': "orm['core.PeriNoticeTerm']", 'to': "orm['core.Term']"}), + 'peru': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'phot': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'pins': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'plieux': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'prep': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'puti': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'reda': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'ref': ('django.db.models.fields.CharField', [], {'max_length': '20', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'refim': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'repr': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'repr_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'repr+'", 'symmetrical': 'False', 'through': "orm['core.ReprNoticeTerm']", 'to': "orm['core.Term']"}), + 'srep': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'srep_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'srep+'", 'symmetrical': 'False', 'through': "orm['core.SrepNoticeTerm']", 'to': "orm['core.Term']"}), + 'stat': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'tech': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'tico': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'titr': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'util': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'video': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'www': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + 'core.noticeimage': { + 'Meta': {'object_name': 'NoticeImage'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'notice': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'images'", 'to': "orm['core.Notice']"}), + 'relative_url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': "'1024'"}) + }, + 'core.noticeterm': { + 'Meta': {'object_name': 'NoticeTerm'}, + 'graph': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'notice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Notice']"}), + 'term': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Term']"}) + }, + 'core.perinoticeterm': { + 'Meta': {'object_name': 'PeriNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.reprnoticeterm': { + 'Meta': {'object_name': 'ReprNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.srepnoticeterm': { + 'Meta': {'object_name': 'SrepNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.term': { + 'Meta': {'object_name': 'Term'}, + 'alternative_wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'dbpedia_uri': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'lang': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'link_semantic_level': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'normalized_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'thesaurus': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Thesaurus']"}), + 'uri': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'url_status': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'validated': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'validation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'validator': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['jocondelab.User']", 'null': 'True', 'blank': 'True'}), + 'wikipedia_edition': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'wikipedia_revision_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'wp_alternative_label': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'wp_label': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '1024', 'null': 'True', 'blank': 'True'}) + }, + 'core.termlabel': { + 'Meta': {'object_name': 'TermLabel'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'lang': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'term': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'alternative_labels'", 'to': "orm['core.Term']"}) + }, + 'core.thesaurus': { + 'Meta': {'ordering': "['label']", 'object_name': 'Thesaurus'}, + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'uri': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + u'jocondelab.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': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + u'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'}), + 'language': ('django.db.models.fields.CharField', [], {'default': "'fr'", 'max_length': '2'}), + '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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + } + } + + complete_apps = ['core'] \ No newline at end of file diff -r b1fd0e0197c8 -r 859862939996 src/core/migrations/0005_set_semantic_link_level.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/core/migrations/0005_set_semantic_link_level.py Tue Jun 25 15:34:18 2013 +0200 @@ -0,0 +1,238 @@ +# -*- coding: utf-8 -*- +from ..utils import show_progress +from core.models.term import TERM_WK_LINK_SEMANTIC_LEVEL_DICT +from django.db import transaction +from south.v2 import DataMigration + +class Migration(DataMigration): + + def forwards(self, orm): + "Write your forwards methods here." + # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..." + total = orm['core.Term'].objects.all().count() + + transaction.enter_transaction_management(True) + transaction.managed() + + writer = None + for i,term in enumerate(orm['core.Term'].objects.all()): + writer = show_progress(i+1, total, u"Processing term %s" % term.label, 50, writer) + term.link_semantic_level = TERM_WK_LINK_SEMANTIC_LEVEL_DICT['--'] if term.url_status is not None else None + term.save() + + if not ((i+1) % 5000): + transaction.commit() + + transaction.commit() + transaction.leave_transaction_management() + + def backwards(self, orm): + pass + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 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'}) + }, + 'core.autrnoticeterm': { + 'Meta': {'object_name': 'AutrNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.domnnoticeterm': { + 'Meta': {'object_name': 'DomnNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.ecolnoticeterm': { + 'Meta': {'object_name': 'EcolNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.epoqnoticeterm': { + 'Meta': {'object_name': 'EpoqNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.lieuxnoticeterm': { + 'Meta': {'object_name': 'LieuxNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.notice': { + 'Meta': {'object_name': 'Notice'}, + 'adpt': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'appl': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'aptn': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'attr': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'autr': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'autr_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'autr+'", 'symmetrical': 'False', 'through': "orm['core.AutrNoticeTerm']", 'to': "orm['core.Term']"}), + 'bibl': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'comm': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'contact': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'coor': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'copy': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'dacq': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'data': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'dation': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'ddpt': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'decv': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'deno': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'depo': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'desc': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'desy': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'dims': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'dmaj': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'dmis': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'domn': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'domn_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'domn+'", 'symmetrical': 'False', 'through': "orm['core.DomnNoticeTerm']", 'to': "orm['core.Term']"}), + 'drep': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'ecol': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'ecol_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'ecol+'", 'symmetrical': 'False', 'through': "orm['core.EcolNoticeTerm']", 'to': "orm['core.Term']"}), + 'epoq': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'epoq_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'epoq+'", 'symmetrical': 'False', 'through': "orm['core.EpoqNoticeTerm']", 'to': "orm['core.Term']"}), + 'etat': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'expo': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'gene': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'geohi': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'hist': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'insc': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'inv': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'labo': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'lieux': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'lieux_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'lieux+'", 'symmetrical': 'False', 'through': "orm['core.LieuxNoticeTerm']", 'to': "orm['core.Term']"}), + 'loca': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'loca2': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'mill': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'milu': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'mosa': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'msgcom': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'museo': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'nsda': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'onom': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'paut': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'pdat': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'pdec': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'peoc': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'peri': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'peri_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'peri+'", 'symmetrical': 'False', 'through': "orm['core.PeriNoticeTerm']", 'to': "orm['core.Term']"}), + 'peru': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'phot': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'pins': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'plieux': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'prep': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'puti': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'reda': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'ref': ('django.db.models.fields.CharField', [], {'max_length': '20', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'refim': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'repr': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'repr_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'repr+'", 'symmetrical': 'False', 'through': "orm['core.ReprNoticeTerm']", 'to': "orm['core.Term']"}), + 'srep': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'srep_terms': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'srep+'", 'symmetrical': 'False', 'through': "orm['core.SrepNoticeTerm']", 'to': "orm['core.Term']"}), + 'stat': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'tech': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'tico': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'titr': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'util': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'video': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'www': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + 'core.noticeimage': { + 'Meta': {'object_name': 'NoticeImage'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'notice': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'images'", 'to': "orm['core.Notice']"}), + 'relative_url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': "'1024'"}) + }, + 'core.noticeterm': { + 'Meta': {'object_name': 'NoticeTerm'}, + 'graph': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'notice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Notice']"}), + 'term': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Term']"}) + }, + 'core.perinoticeterm': { + 'Meta': {'object_name': 'PeriNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.reprnoticeterm': { + 'Meta': {'object_name': 'ReprNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.srepnoticeterm': { + 'Meta': {'object_name': 'SrepNoticeTerm', '_ormbases': ['core.NoticeTerm']}, + u'noticeterm_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['core.NoticeTerm']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'core.term': { + 'Meta': {'object_name': 'Term'}, + 'alternative_wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'dbpedia_uri': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'lang': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'link_semantic_level': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'normalized_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'thesaurus': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Thesaurus']"}), + 'uri': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'url_status': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'validated': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'validation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'validator': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['jocondelab.User']", 'null': 'True', 'blank': 'True'}), + 'wikipedia_edition': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'wikipedia_revision_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'wp_alternative_label': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'wp_label': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '1024', 'null': 'True', 'blank': 'True'}) + }, + 'core.termlabel': { + 'Meta': {'object_name': 'TermLabel'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'lang': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'term': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'alternative_labels'", 'to': "orm['core.Term']"}) + }, + 'core.thesaurus': { + 'Meta': {'ordering': "['label']", 'object_name': 'Thesaurus'}, + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'uri': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + u'jocondelab.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': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + u'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'}), + 'language': ('django.db.models.fields.CharField', [], {'default': "'fr'", 'max_length': '2'}), + '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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + } + } + + complete_apps = ['core'] + symmetrical = True diff -r b1fd0e0197c8 -r 859862939996 src/core/models/term.py --- a/src/core/models/term.py Tue Jun 25 10:28:25 2013 +0200 +++ b/src/core/models/term.py Tue Jun 25 15:34:18 2013 +0200 @@ -39,7 +39,32 @@ "match":3, "unsemantized":4, } - + +TERM_WK_LINK_SEMANTIC_LEVEL_CHOICES = ( + (0, "--"), + (1, "EE"), + (2, "EI"), + (3, "BM"), + (4, "NM") +) + +TERM_WK_LINK_SEMANTIC_LEVEL_CHOICES_TRANS = ( + (0, _("--")), + (1, _("EE")), + (2, _("EI")), + (3, _("BM")), + (4, _("NM")) +) + +TERM_WK_LINK_SEMANTIC_LEVEL_DICT = { + "--" : 0, + "EE" : 1, + "EI" : 2, + "BM" : 3, + "NM" : 4 +} + + class Thesaurus(models.Model): label = models.CharField(max_length=128, unique=True, blank=False, null=False, db_index=True) title = models.CharField(max_length=1024, unique=False, blank=False, null=False, db_index=False) @@ -69,6 +94,7 @@ alternative_wikipedia_url = models.URLField(max_length=2048, blank=True, null=True, db_index=True) alternative_wikipedia_pageid = models.BigIntegerField(unique=False, blank=True, null=True, db_index=True) url_status = models.IntegerField(choices=TERM_URL_STATUS_CHOICES_TRANS, blank=True, null=True, default=None, db_index=True) + link_semantic_level = models.IntegerField(choices=TERM_WK_LINK_SEMANTIC_LEVEL_CHOICES_TRANS, blank=True, null=True, default=None, db_index=True) dbpedia_uri = models.URLField(max_length=2048, blank=True, null=True, db_index=True) validation_date = models.DateTimeField(null=True, blank=True, serialize=False) validated = models.BooleanField(default=False, db_index=True) diff -r b1fd0e0197c8 -r 859862939996 src/core/utils.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/core/utils.py Tue Jun 25 15:34:18 2013 +0200 @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +''' +Created on Feb 1, 2012 + +@author: ymh +''' +import sys +import codecs #@UnresolvedImport +import math + +def show_progress(current_line, total_line, label, width, writer=None): + + if writer is None: + writer = sys.stdout + if sys.stdout.encoding is not None: + writer = codecs.getwriter(sys.stdout.encoding)(sys.stdout) + + percent = (float(current_line) / float(total_line)) * 100.0 + + marks = math.floor(width * (percent / 100.0)) #@UndefinedVariable + spaces = math.floor(width - marks) #@UndefinedVariable + + loader = u'[' + (u'=' * int(marks)) + (u' ' * int(spaces)) + u']' + + s = u"%s %3d%% %*d/%d - %*s\r" % (loader, percent, len(str(total_line)), current_line, total_line, width, label[:width]) + + writer.write(s) #takes the header into account + if percent >= 100: + writer.write("\n") + writer.flush() + + return writer diff -r b1fd0e0197c8 -r 859862939996 src/core/wp_utils.py --- a/src/core/wp_utils.py Tue Jun 25 10:28:25 2013 +0200 +++ b/src/core/wp_utils.py Tue Jun 25 15:34:18 2013 +0200 @@ -4,6 +4,7 @@ from django.utils.http import urlquote from wikitools import api, wiki import logging +from core.models.term import TERM_WK_LINK_SEMANTIC_LEVEL_DICT logger = logging.getLogger(__name__) site = None @@ -191,6 +192,7 @@ term.wp_label = new_label if status is not None: term.url_status = status + term.link_semantic_level = TERM_WK_LINK_SEMANTIC_LEVEL_DICT['--'] term.wikipedia_url = url term.wikipedia_pageid = pageid term.dbpedia_uri = dbpedia_uri diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/forms.py --- a/src/jocondelab/forms.py Tue Jun 25 10:28:25 2013 +0200 +++ b/src/jocondelab/forms.py Tue Jun 25 15:34:18 2013 +0200 @@ -21,6 +21,10 @@ term_id = fields.IntegerField(required=True) label = fields.CharField(required=True, min_length=1) +class LinkSemanticLevelForm(Form): + term_id = fields.IntegerField(required=True) + link_semantic_level = fields.IntegerField(required=True) + class RemoveWpLinkForm(Form): term_id = fields.IntegerField(required=True) diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/locale/en/LC_MESSAGES/django.mo Binary file src/jocondelab/locale/en/LC_MESSAGES/django.mo has changed diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/locale/en/LC_MESSAGES/django.po --- a/src/jocondelab/locale/en/LC_MESSAGES/django.po Tue Jun 25 10:28:25 2013 +0200 +++ b/src/jocondelab/locale/en/LC_MESSAGES/django.po Tue Jun 25 15:34:18 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-06-24 23:51+0200\n" +"POT-Creation-Date: 2013-06-25 14:08+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,47 +20,47 @@ msgid "language" msgstr "language" -#: forms.py:34 +#: forms.py:38 msgid "thesaurus" msgstr "thesaurus" -#: forms.py:35 forms.py:38 templates/jocondelab/term_edit.html:71 +#: forms.py:39 forms.py:42 templates/jocondelab/term_edit.html:72 msgid "label" msgstr "label" -#: forms.py:36 +#: forms.py:40 msgid "link_status" msgstr "link status" -#: forms.py:37 +#: forms.py:41 msgid "validated" msgstr "valid." -#: forms.py:37 +#: forms.py:41 msgid "yes" msgstr "yes" -#: forms.py:37 +#: forms.py:41 msgid "no" msgstr "no" -#: forms.py:38 +#: forms.py:42 msgid "order_by" msgstr "order by" -#: forms.py:38 templates/jocondelab/term_edit.html:89 +#: forms.py:42 templates/jocondelab/term_edit.html:90 msgid "uri" msgstr "uri" -#: forms.py:39 +#: forms.py:43 msgid "order_dir" msgstr "sort order" -#: forms.py:39 +#: forms.py:43 msgid "asc" msgstr "asc." -#: forms.py:39 +#: forms.py:43 msgid "desc" msgstr "desc." @@ -68,31 +68,31 @@ msgid "French" msgstr "French" -#: templates/jocondelab/term_edit.html:75 +#: templates/jocondelab/term_edit.html:76 msgid "alternative labels" msgstr "alternative labels" -#: templates/jocondelab/term_edit.html:85 +#: templates/jocondelab/term_edit.html:86 msgid "id" msgstr "id" -#: templates/jocondelab/term_edit.html:93 +#: templates/jocondelab/term_edit.html:94 msgid "info wikipedia" msgstr "Wikipedia info" -#: templates/jocondelab/term_edit.html:102 +#: templates/jocondelab/term_edit.html:103 msgid "Créer page WK" msgstr "Create WK page" -#: templates/jocondelab/term_edit.html:102 +#: templates/jocondelab/term_edit.html:103 msgid "Need wikipedia article" msgstr "Need wikipedia article" -#: templates/jocondelab/term_edit.html:122 +#: templates/jocondelab/term_edit.html:134 msgid "Rech. joconde" msgstr "Joconde search" -#: templates/jocondelab/term_edit.html:128 +#: templates/jocondelab/term_edit.html:140 msgid "Edition wk" msgstr "WK Edition" diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/locale/fr/LC_MESSAGES/django.mo Binary file src/jocondelab/locale/fr/LC_MESSAGES/django.mo has changed diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/locale/fr/LC_MESSAGES/django.po --- a/src/jocondelab/locale/fr/LC_MESSAGES/django.po Tue Jun 25 10:28:25 2013 +0200 +++ b/src/jocondelab/locale/fr/LC_MESSAGES/django.po Tue Jun 25 15:34:18 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-06-24 23:51+0200\n" +"POT-Creation-Date: 2013-06-25 14:08+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,47 +21,47 @@ msgid "language" msgstr "langue" -#: forms.py:34 +#: forms.py:38 msgid "thesaurus" msgstr "thésaurus" -#: forms.py:35 forms.py:38 templates/jocondelab/term_edit.html:71 +#: forms.py:39 forms.py:42 templates/jocondelab/term_edit.html:72 msgid "label" msgstr "label" -#: forms.py:36 +#: forms.py:40 msgid "link_status" msgstr "statut lien" -#: forms.py:37 +#: forms.py:41 msgid "validated" msgstr "validé" -#: forms.py:37 +#: forms.py:41 msgid "yes" msgstr "oui" -#: forms.py:37 +#: forms.py:41 msgid "no" msgstr "non" -#: forms.py:38 +#: forms.py:42 msgid "order_by" msgstr "ord. par" -#: forms.py:38 templates/jocondelab/term_edit.html:89 +#: forms.py:42 templates/jocondelab/term_edit.html:90 msgid "uri" msgstr "uri" -#: forms.py:39 +#: forms.py:43 msgid "order_dir" msgstr "ordre tri" -#: forms.py:39 +#: forms.py:43 msgid "asc" msgstr "asc." -#: forms.py:39 +#: forms.py:43 msgid "desc" msgstr "desc." @@ -69,31 +69,31 @@ msgid "French" msgstr "Français" -#: templates/jocondelab/term_edit.html:75 +#: templates/jocondelab/term_edit.html:76 msgid "alternative labels" msgstr "Autres labels" -#: templates/jocondelab/term_edit.html:85 +#: templates/jocondelab/term_edit.html:86 msgid "id" msgstr "id" -#: templates/jocondelab/term_edit.html:93 +#: templates/jocondelab/term_edit.html:94 msgid "info wikipedia" msgstr "info wikipedia" -#: templates/jocondelab/term_edit.html:102 +#: templates/jocondelab/term_edit.html:103 msgid "Créer page WK" msgstr "Créer page WK" -#: templates/jocondelab/term_edit.html:102 +#: templates/jocondelab/term_edit.html:103 msgid "Need wikipedia article" msgstr "Besoin article Wikipedia" -#: templates/jocondelab/term_edit.html:122 +#: templates/jocondelab/term_edit.html:134 msgid "Rech. joconde" msgstr "Rech. Joconde" -#: templates/jocondelab/term_edit.html:128 +#: templates/jocondelab/term_edit.html:140 msgid "Edition wk" msgstr "Edition wk" diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/management/commands/import_csv.py --- a/src/jocondelab/management/commands/import_csv.py Tue Jun 25 10:28:25 2013 +0200 +++ b/src/jocondelab/management/commands/import_csv.py Tue Jun 25 15:34:18 2013 +0200 @@ -5,14 +5,15 @@ @author: ymh ''' -from ..utils import show_progress from core.import_processor import (CharFieldProcessor, DateFieldProcessor, - BooleanFieldProcessor, TermProcessor, TrimCharFieldProcessor, + BooleanFieldProcessor, TermProcessor, TrimCharFieldProcessor, VideoFieldProcessor) from core.models import (Notice, AutrNoticeTerm, DomnNoticeTerm, EcolNoticeTerm, EpoqNoticeTerm, LieuxNoticeTerm, PeriNoticeTerm, ReprNoticeTerm) +from core.models.notice import SrepNoticeTerm from core.settings import (AUTR_CONTEXT, DOMN_CONTEXT, ECOL_CONTEXT, EPOQ_CONTEXT, LIEUX_CONTEXT, PERI_CONTEXT, REPR_CONTEXT, SREP_CONTEXT) +from core.utils import show_progress from django.core.management import BaseCommand from django.db import transaction from optparse import make_option @@ -21,7 +22,6 @@ import logging import os.path import sys -from core.models.notice import SrepNoticeTerm logger = logging.getLogger(__name__) @@ -230,5 +230,5 @@ error_msg = "%s - Error treating line: %s\n" % (datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"), repr(e) ) logger.exception(error_msg) - + transaction.leave_transaction_management() \ No newline at end of file diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/management/commands/import_term_labels.py --- a/src/jocondelab/management/commands/import_term_labels.py Tue Jun 25 10:28:25 2013 +0200 +++ b/src/jocondelab/management/commands/import_term_labels.py Tue Jun 25 15:34:18 2013 +0200 @@ -72,4 +72,5 @@ transaction.commit() transaction.commit() + transaction.leave_transaction_management() \ No newline at end of file diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/management/commands/import_terms.py --- a/src/jocondelab/management/commands/import_terms.py Tue Jun 25 10:28:25 2013 +0200 +++ b/src/jocondelab/management/commands/import_terms.py Tue Jun 25 15:34:18 2013 +0200 @@ -115,4 +115,5 @@ transaction.commit() transaction.commit() + transaction.leave_transaction_management() \ No newline at end of file diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/management/utils.py --- a/src/jocondelab/management/utils.py Tue Jun 25 10:28:25 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -''' -Created on Feb 1, 2012 - -@author: ymh -''' -import sys -import codecs #@UnresolvedImport -import math - -def show_progress(current_line, total_line, label, width, writer=None): - - if writer is None: - writer = sys.stdout - if sys.stdout.encoding is not None: - writer = codecs.getwriter(sys.stdout.encoding)(sys.stdout) - - percent = (float(current_line) / float(total_line)) * 100.0 - - marks = math.floor(width * (percent / 100.0)) #@UndefinedVariable - spaces = math.floor(width - marks) #@UndefinedVariable - - loader = u'[' + (u'=' * int(marks)) + (u' ' * int(spaces)) + u']' - - s = u"%s %3d%% %*d/%d - %*s\r" % (loader, percent, len(str(total_line)), current_line, total_line, width, label[:width]) - - writer.write(s) #takes the header into account - if percent >= 100: - writer.write("\n") - writer.flush() - - return writer diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/static/jocondelab/js/jocondelab.js --- a/src/jocondelab/static/jocondelab/js/jocondelab.js Tue Jun 25 10:28:25 2013 +0200 +++ b/src/jocondelab/static/jocondelab/js/jocondelab.js Tue Jun 25 15:34:18 2013 +0200 @@ -23,6 +23,19 @@ ); }); + $("#link_semantic_level").change(function(e) { + $.post(link_semantic_level_url, + { + csrfmiddlewaretoken:global_csrf_token, + term_id:term_id, + link_semantic_level: $("#link_semantic_level").val() + }, + function(data, textStatus) { + window.location.reload(true); + } + ); + }); + // Wikipedia search management (new tag) $("#wp_search").autocomplete({ source: function( request, response ) { diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/templates/jocondelab/term_edit.html --- a/src/jocondelab/templates/jocondelab/term_edit.html Tue Jun 25 10:28:25 2013 +0200 +++ b/src/jocondelab/templates/jocondelab/term_edit.html Tue Jun 25 15:34:18 2013 +0200 @@ -16,7 +16,8 @@ var remove_wp_link_url = "{% url 'remove_wp_link' %}"; var term_wikipedia_edition_url = "{% url 'edition_wp_link'%}"; var validate_term_url = "{% url 'validate_term' %}"; - var term_list_table_url = "{% url 'term_list_table' %}"; + var term_list_table_url = "{% url 'term_list_table' %}"; + var link_semantic_level_url = "{% url 'editon_link_semantic_level' %}"; $(document).ready(function(){ init_term_events(); @@ -116,6 +117,17 @@   {% endif %} + + {% if term.dbpedia_uri and term.dbpedia_uri != "" %} + + {% else %} +   + {% endif %} + diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/urls.py --- a/src/jocondelab/urls.py Tue Jun 25 10:28:25 2013 +0200 +++ b/src/jocondelab/urls.py Tue Jun 25 15:34:18 2013 +0200 @@ -1,5 +1,6 @@ from .views import (TermListView, TermEditView, TermModifyWpLink, - TermRemoveWpLink, TermValidate, TermWikipediaEdition) + TermRemoveWpLink, TermValidate, TermWikipediaEdition, + TermLinkSemanticLevelEdition) from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.auth import urls as auth_url @@ -23,6 +24,7 @@ url(r'^bo/term/modify-wp/$', login_required(TermModifyWpLink.as_view()), name='modify_wp_link'), url(r'^bo/term/remove-wp/$', login_required(TermRemoveWpLink.as_view()), name='remove_wp_link'), url(r'^bo/term/edition-wp/$', login_required(TermWikipediaEdition.as_view()), name='edition_wp_link'), + url(r'^bo/term/edition-link-level/$', login_required(TermLinkSemanticLevelEdition.as_view()), name='editon_link_semantic_level'), url(r'^bo/term/validate/$', login_required(TermValidate.as_view()), name='validate_term'), ) diff -r b1fd0e0197c8 -r 859862939996 src/jocondelab/views.py --- a/src/jocondelab/views.py Tue Jun 25 10:28:25 2013 +0200 +++ b/src/jocondelab/views.py Tue Jun 25 15:34:18 2013 +0200 @@ -9,12 +9,14 @@ TermFilterForm) from .utils import JocondePaginator from core.models import Term, TERM_URL_STATUS_DICT +from core.models.term import (TERM_WK_LINK_SEMANTIC_LEVEL_DICT, + TERM_WK_LINK_SEMANTIC_LEVEL_CHOICES) from core.wp_utils import process_term as wp_process_term from django.conf import settings from django.http.response import HttpResponse from django.views.generic import ListView, DetailView, View +from jocondelab.forms import WikipediaEditionForm, LinkSemanticLevelForm import logging -from jocondelab.forms import WikipediaEditionForm logger = logging.getLogger(__name__) @@ -75,6 +77,7 @@ def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['filter_form'] = self.get_filter_form() + context['link_semantic_level_choice'] = TERM_WK_LINK_SEMANTIC_LEVEL_CHOICES return context @@ -136,6 +139,7 @@ self.term.dbpedia_uri = None self.term.wikipedia_revision_id = None self.term.url_status = TERM_URL_STATUS_DICT["unsemantized"] + self.link_semantic_level = TERM_WK_LINK_SEMANTIC_LEVEL_DICT['--'] self.term.save() @@ -166,4 +170,15 @@ self.term.save() return HttpResponse(status=204) - \ No newline at end of file + +class TermLinkSemanticLevelEdition(TermUpdateView): + + form_class = LinkSemanticLevelForm + + def process_term(self, request): + + self.term.link_semantic_level = self.form_values['link_semantic_level'] + self.term.save() + + return HttpResponse(status=204) + \ No newline at end of file