# HG changeset patch # User cavaliet # Date 1405604368 -7200 # Node ID af29252631ac06f6250fc0d91f2d2bf6a45a35a6 # Parent 6c12ccf29a95e25d00ddcc8999a7184d8b881f04 renkan object with thumbnail diff -r 6c12ccf29a95 -r af29252631ac .settings/org.eclipse.core.resources.prefs --- a/.settings/org.eclipse.core.resources.prefs Thu Jul 17 10:43:56 2014 +0200 +++ b/.settings/org.eclipse.core.resources.prefs Thu Jul 17 15:39:28 2014 +0200 @@ -37,6 +37,7 @@ encoding//src/hdalab/migrations/0001_initial.py=utf-8 encoding//src/hdalab/migrations/0002_dataviz.py=utf-8 encoding//src/hdalab/migrations/0003_hdasession.py=utf-8 +encoding//src/hdalab/migrations/0004_remove_dbpedia_unicity.py=utf-8 encoding//src/hdalab/migrations/0005_rename_end_year.py=utf-8 encoding//src/hdalab/migrations/0006_dbpedia_fields_one_to_one.py=utf-8 encoding//src/hdalab/migrations/0007_geographic_inclusion.py=utf-8 diff -r 6c12ccf29a95 -r af29252631ac src/hdabo/settings.py --- a/src/hdabo/settings.py Thu Jul 17 10:43:56 2014 +0200 +++ b/src/hdabo/settings.py Thu Jul 17 15:39:28 2014 +0200 @@ -131,8 +131,14 @@ 'registration', 'haystack', 'hdalab', + 'easy_thumbnails', ) +SOUTH_MIGRATION_MODULES = { + 'easy_thumbnails': 'easy_thumbnails.south_migrations', +} +DEFAULT_RENKAN_ICON = "thumbnails/renkan/renkan_default_icon.png" + ugettext = lambda s:s LANGUAGES = ( ('fr', ugettext('French')), @@ -157,6 +163,8 @@ ACCOUNT_ACTIVATION_DAYS = 7 +THUMBNAIL_DEBUG = True + from hdabo.config import * #@UnusedWildImport if 'LOGIN_REDIRECT_URL' not in locals(): diff -r 6c12ccf29a95 -r af29252631ac src/hdalab/migrations/0012_auto__add_renkan.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdalab/migrations/0012_auto__add_renkan.py Thu Jul 17 15:39:28 2014 +0200 @@ -0,0 +1,325 @@ +# -*- 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): + # Adding model 'Renkan' + db.create_table(u'hdalab_renkan', ( + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.User'])), + ('rk_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=1024)), + ('content', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), + ('title', self.gf('django.db.models.fields.CharField')(max_length=1024, null=True)), + ('state', self.gf('django.db.models.fields.IntegerField')(default=1)), + ('image', self.gf('django.db.models.fields.files.ImageField')(default='thumbnails/renkan/renkan_default_icon.png', max_length=100)), + ('creation_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), + ('modification_date', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), + )) + db.send_create_signal('hdalab', ['Renkan']) + + + def backwards(self, orm): + # Deleting model 'Renkan' + db.delete_table(u'hdalab_renkan') + + + 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'}) + }, + u'hdabo.author': { + 'Meta': {'object_name': 'Author'}, + 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + u'hdabo.datasheet': { + 'Meta': {'object_name': 'Datasheet'}, + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Author']", 'null': 'True', 'blank': 'True'}), + 'college_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_periods_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_college_periods']", 'to': u"orm['hdabo.TimePeriod']"}), + 'college_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_themes_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_college_themes']", 'to': u"orm['hdabo.Domain']"}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'domains': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_domains']", 'to': u"orm['hdabo.Domain']"}), + 'format': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.DocumentFormat']", 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'highschool_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_periods_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_highschool_periods']", 'to': u"orm['hdabo.TimePeriod']"}), + 'highschool_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_themes_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_highschool_themes']", 'to': u"orm['hdabo.Domain']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manual_order': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'modification_datetime': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'organisation': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Organisation']", 'null': 'True'}), + 'original_creation_date': ('django.db.models.fields.DateField', [], {}), + 'original_modification_date': ('django.db.models.fields.DateField', [], {}), + 'primary_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_periods_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_primary_periods']", 'to': u"orm['hdabo.TimePeriod']"}), + 'primary_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_themes_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_primary_themes']", 'to': u"orm['hdabo.Domain']"}), + 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['hdabo.Tag']", 'through': u"orm['hdabo.TaggedSheet']", 'symmetrical': 'False'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), + 'town': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Location']", 'null': 'True', 'blank': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': '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['hdabo.User']", 'null': 'True', 'blank': 'True'}) + }, + u'hdabo.datasheet_college_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.TimePeriod']"}) + }, + u'hdabo.datasheet_college_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Domain']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.datasheet_domains': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_domains'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Domain']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.datasheet_highschool_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.TimePeriod']"}) + }, + u'hdabo.datasheet_highschool_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Domain']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.datasheet_primary_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.TimePeriod']"}) + }, + u'hdabo.datasheet_primary_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Domain']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.documentformat': { + 'Meta': {'object_name': 'DocumentFormat'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + u'hdabo.domain': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'Domain'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.location': { + 'Meta': {'object_name': 'Location'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '5'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}) + }, + u'hdabo.organisation': { + 'Meta': {'object_name': 'Organisation'}, + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'website': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + u'hdabo.tag': { + 'Meta': {'unique_together': "(('label', 'original_label', 'url_status'),)", 'object_name': 'Tag'}, + 'alias': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + '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'}), + 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.TagCategory']", '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'}), + 'normalized_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'original_label': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'popularity': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'url_status': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + u'hdabo.tagcategory': { + 'Meta': {'object_name': 'TagCategory'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + u'hdabo.taggedsheet': { + 'Meta': {'object_name': 'TaggedSheet'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index_note': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'original_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Tag']"}), + 'wikipedia_revision_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + u'hdabo.timeperiod': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'TimePeriod'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.user': { + 'Meta': {'object_name': 'User', 'db_table': "'auth_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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + 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'}), + '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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'hdalab.country': { + 'Meta': {'object_name': 'Country'}, + 'dbpedia_uri': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + }, + 'hdalab.datasheetextras': { + 'Meta': {'object_name': 'DatasheetExtras'}, + 'datasheet': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'extras'", 'unique': 'True', 'to': u"orm['hdabo.Datasheet']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insee': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdalab.InseeCoords']", 'null': 'True', 'blank': 'True'}) + }, + 'hdalab.dbpediafields': { + 'Meta': {'object_name': 'DbpediaFields'}, + 'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'dbpedia_uri': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'db_index': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'tag': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'dbpedia_fields'", 'unique': 'True', 'null': 'True', 'to': u"orm['hdabo.Tag']"}), + 'thumbnail': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'hdalab.dbpediafieldstranslation': { + 'Meta': {'unique_together': "(('master', 'language_code'),)", 'object_name': 'DbpediaFieldsTranslation'}, + 'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_abstract_translated': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_label_translated': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'blank': 'True'}), + 'language_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), + 'master': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'to': "orm['hdalab.DbpediaFields']"}) + }, + 'hdalab.geoinclusion': { + 'Meta': {'object_name': 'GeoInclusion'}, + 'country': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'includes'", 'to': "orm['hdalab.Country']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'tag': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'locatedin'", 'unique': 'True', 'to': u"orm['hdabo.Tag']"}) + }, + 'hdalab.hdasession': { + 'Meta': {'object_name': 'HdaSession'}, + 'data': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sessionid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '36', 'db_index': 'True'}) + }, + 'hdalab.infoboxparameter': { + 'Meta': {'unique_together': "(('tag_infobox', 'param_name'),)", 'object_name': 'InfoboxParameter'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'param_name': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), + 'param_value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'tag_infobox': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdalab.TagInfobox']"}) + }, + 'hdalab.inseecoords': { + 'Meta': {'object_name': 'InseeCoords'}, + 'city_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'insee': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}), + 'latitude': ('django.db.models.fields.FloatField', [], {}), + 'longitude': ('django.db.models.fields.FloatField', [], {}) + }, + 'hdalab.renkan': { + 'Meta': {'object_name': 'Renkan'}, + 'content': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('django.db.models.fields.files.ImageField', [], {'default': "'thumbnails/renkan/renkan_default_icon.png'", 'max_length': '100'}), + 'modification_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.User']"}), + 'rk_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '1024'}), + 'state': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}) + }, + 'hdalab.taginfobox': { + 'Meta': {'unique_together': "(('tag', 'name', 'revision_id'),)", 'object_name': 'TagInfobox'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), + 'revision_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'source': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'infoboxes'", 'to': u"orm['hdabo.Tag']"}) + }, + 'hdalab.taglinks': { + 'Meta': {'object_name': 'TagLinks'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taglinks_objects'", 'to': u"orm['hdabo.Tag']"}), + 'subject': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taglinks_subjects'", 'to': u"orm['hdabo.Tag']"}) + }, + 'hdalab.tagwpcategory': { + 'Meta': {'unique_together': "(('tag', 'wp_category', 'hidden'),)", 'object_name': 'TagWpCategory'}, + 'hidden': ('django.db.models.fields.BooleanField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'wp_categories'", 'to': u"orm['hdabo.Tag']"}), + 'wp_category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tags'", 'to': "orm['hdalab.WpCategory']"}) + }, + 'hdalab.tagyears': { + 'Meta': {'object_name': 'TagYears'}, + 'end_year': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'start_year': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'years'", 'to': u"orm['hdabo.Tag']"}) + }, + 'hdalab.wpcategory': { + 'Meta': {'object_name': 'WpCategory'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '2048'}) + }, + 'hdalab.wpcategoryinclusion': { + 'Meta': {'unique_together': "(('parent_category', 'child_category'),)", 'object_name': 'WpCategoryInclusion'}, + 'child_category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parent_categories'", 'to': "orm['hdalab.WpCategory']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'parent_category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'child_categories'", 'to': "orm['hdalab.WpCategory']"}) + } + } + + complete_apps = ['hdalab'] \ No newline at end of file diff -r 6c12ccf29a95 -r af29252631ac src/hdalab/models/__init__.py --- a/src/hdalab/models/__init__.py Thu Jul 17 10:43:56 2014 +0200 +++ b/src/hdalab/models/__init__.py Thu Jul 17 15:39:28 2014 +0200 @@ -1,5 +1,6 @@ from hdalab.models.categories import (WpCategory, InfoboxParameter, TagInfobox, TagWpCategory, WpCategoryInclusion) from hdalab.models.dataviz import TagYears, Country, GeoInclusion, TagLinks, DbpediaFields, HdaSession, InseeCoords, DatasheetExtras, DbpediaFieldsTranslation +from hdalab.models.renkan import Renkan -__all__ = ['WpCategory', 'InfoboxParameter', 'TagInfobox', 'TagWpCategory', 'TagYears', 'Country', 'GeoInclusion', 'TagLinks', 'DbpediaFields', 'DbpediaFieldsTranslation', 'HdaSession', 'InseeCoords', 'DatasheetExtras', 'WpCategoryInclusion'] \ No newline at end of file +__all__ = ['WpCategory', 'InfoboxParameter', 'TagInfobox', 'TagWpCategory', 'TagYears', 'Country', 'GeoInclusion', 'TagLinks', 'DbpediaFields', 'DbpediaFieldsTranslation', 'HdaSession', 'InseeCoords', 'DatasheetExtras', 'WpCategoryInclusion', 'Renkan'] \ No newline at end of file diff -r 6c12ccf29a95 -r af29252631ac src/hdalab/models/renkan.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdalab/models/renkan.py Thu Jul 17 15:39:28 2014 +0200 @@ -0,0 +1,36 @@ +''' +Created on Jul 17, 2014 + +@author: tc +''' +from django.conf import settings +from django.db import models +from hdabo.models import User +from easy_thumbnails.fields import ThumbnailerImageField + + +class Renkan(models.Model): + + EDITION = 1 + PUBLISHED = 2 + MODERATED = 3 + REJECTED = 4 + + STATE_CHOICES = ( + (EDITION, 'edition'), + (PUBLISHED, 'published'), + (MODERATED, 'moderated'), + (REJECTED, 'rejected'), + ) + + owner = models.ForeignKey(User, blank=False, null=False) + rk_id = models.CharField(max_length=1024, unique=True, blank=False, null=False) # typically UUID + content = models.TextField(blank=True, null=True) + title = models.CharField(max_length=1024, null=True) + state = models.IntegerField(choices=STATE_CHOICES, default=1) + image = ThumbnailerImageField(upload_to="thumbnails/renkan/", default=settings.DEFAULT_RENKAN_ICON) + creation_date = models.DateTimeField(auto_now_add=True) + modification_date = models.DateTimeField(auto_now=True) + + class Meta: + app_label = 'hdalab' diff -r 6c12ccf29a95 -r af29252631ac src/hdalab/templates/profile_home.html --- a/src/hdalab/templates/profile_home.html Thu Jul 17 10:43:56 2014 +0200 +++ b/src/hdalab/templates/profile_home.html Thu Jul 17 15:39:28 2014 +0200 @@ -1,6 +1,7 @@ {% extends "base.html" %} {% load i18n %} {% load static %} +{% load thumbnail %} {% block title %}{{block.super}} > Profil utilisateur : {{ user.username }}{% endblock %} @@ -19,9 +20,8 @@ {% for r in renkan_list %} {{ r.title }} ({{ r.id }}) - {{ r.modification_date|date:"Y-m-d H:i" }} - + {% thumbnail r.image 100x100 as thumb %} diff -r 6c12ccf29a95 -r af29252631ac src/hdalab/views/profile.py --- a/src/hdalab/views/profile.py Thu Jul 17 10:43:56 2014 +0200 +++ b/src/hdalab/views/profile.py Thu Jul 17 15:39:28 2014 +0200 @@ -5,8 +5,9 @@ @author: tc ''' from datetime import datetime +from django.conf import settings from django.views.generic import TemplateView -import json +from hdalab.models.renkan import Renkan import logging logger = logging.getLogger(__name__) @@ -19,11 +20,22 @@ def get_context_data(self, **kwargs): context = super(ProfileHome, self).get_context_data(**kwargs) - now = datetime.utcnow() - context['renkan_list'] = [ - {"id":"a", "title":"title Renkan 1", "modification_date":now, "thumbnail":"http://icons.iconarchive.com/icons/visualpharm/ios7v2/256/Charts-Mind-map-icon.png"}, - {"id":"b", "title":"2 title Renkan 2", "modification_date":now, "thumbnail":"http://a5.mzstatic.com/us/r30/Purple4/v4/ec/6f/d1/ec6fd10f-f295-eed7-d94f-3d9da39efc64/icon_256.png"} - ] +# now = datetime.utcnow().isoformat() +# +# rk = Renkan() +# rk.rk_id = now +# rk.owner = self.request.user +# rk.content = '{"parrot":"dead"}' +# rk.title = now +# rk.save() + + context['renkan_list'] = Renkan.objects.all() + + #now = datetime.utcnow() + #context['renkan_list'] = [ + # {"id":"a", "title":"title Renkan 1", "modification_date":now, "thumbnail":"http://icons.iconarchive.com/icons/visualpharm/ios7v2/256/Charts-Mind-map-icon.png"}, + # {"id":"b", "title":"2 title Renkan 2", "modification_date":now, "thumbnail":"http://a5.mzstatic.com/us/r30/Purple4/v4/ec/6f/d1/ec6fd10f-f295-eed7-d94f-3d9da39efc64/icon_256.png"} + #] return context diff -r 6c12ccf29a95 -r af29252631ac virtualenv/res/lib/lib_create_env.py --- a/virtualenv/res/lib/lib_create_env.py Thu Jul 17 10:43:56 2014 +0200 +++ b/virtualenv/res/lib/lib_create_env.py Thu Jul 17 15:39:28 2014 +0200 @@ -34,6 +34,8 @@ 'SPARQLWRAPPER' : { 'setup': 'SPARQLWrapper', 'url': 'http://downloads.sourceforge.net/project/sparql-wrapper/sparql-wrapper-python/1.5.0/SPARQLWrapper-1.5.0.tar.gz', 'local' : 'SPARQLWrapper-1.5.0.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, 'REQUESTS' : { 'setup': 'requests', 'url': 'https://github.com/kennethreitz/requests/archive/v2.3.0.tar.gz', 'local' : 'requests-2.3.0.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, 'PYELASTICSEARCH' : { 'setup': 'pyelasticsearch', 'url': 'https://github.com/rhec/pyelasticsearch/archive/0.6.1.tar.gz', 'local' : 'pyelasticsearch-0.6.1.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, + 'PIL' : { 'setup': 'pil', 'url': 'http://effbot.org/downloads/Imaging-1.1.7.tar.gz', 'local' : 'Imaging-1.1.7.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, + 'EASYTHUMBNAIL' : { 'setup': 'easythumbnail', 'url': 'https://github.com/SmileyChris/easy-thumbnails/archive/2.0.1.tar.gz', 'local' : 'easy-thumbnails-2.0.1.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, } if system_str == 'Windows': diff -r 6c12ccf29a95 -r af29252631ac virtualenv/res/src/easy-thumbnails-2.0.1.tar.gz Binary file virtualenv/res/src/easy-thumbnails-2.0.1.tar.gz has changed diff -r 6c12ccf29a95 -r af29252631ac virtualenv/web/res/res_create_env.py --- a/virtualenv/web/res/res_create_env.py Thu Jul 17 10:43:56 2014 +0200 +++ b/virtualenv/web/res/res_create_env.py Thu Jul 17 15:39:28 2014 +0200 @@ -7,7 +7,7 @@ INSTALLS = [ #(key,method, option_str, dict_extra_env) 'LXML', 'PSYCOPG2', - #'PIL', + 'PIL', 'DJANGO', 'DJANGO-EXTENSIONS', 'REGISTRATION', @@ -22,6 +22,7 @@ 'PYYAML', 'REQUESTS', 'PYELASTICSEARCH', + 'EASYTHUMBNAIL', ] if system_str == 'Windows': diff -r 6c12ccf29a95 -r af29252631ac web/static/media/thumbnails/renkan/renkan_default_icon.png Binary file web/static/media/thumbnails/renkan/renkan_default_icon.png has changed