diff --git a/beat/web/libraries/migrations/0001_initial.py b/beat/web/libraries/migrations/0001_initial.py index 03a2ce5a74e4b37706dc66b123e9c296534a156d..9fe5930b6c8d0c6aa8d194d4f84dfd9a706c9faf 100644 --- a/beat/web/libraries/migrations/0001_initial.py +++ b/beat/web/libraries/migrations/0001_initial.py @@ -27,52 +27,202 @@ from __future__ import unicode_literals -from django.db import migrations, models +from django.conf import settings +from django.db import migrations +from django.db import models + import beat.web.code.models import beat.web.common.models import beat.web.libraries.models -from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('team', '0001_initial'), + ("team", "0001_initial"), ] operations = [ migrations.CreateModel( - name='Library', + name="Library", fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('sharing', models.CharField(default='P', max_length=1, choices=[('P', 'Private'), ('S', 'Shared'), ('A', 'Public'), ('U', 'Usable')])), - ('name', models.CharField(help_text='The name for this object (space-like characters will be automatically replaced by dashes)', max_length=200)), - ('version', models.PositiveIntegerField(default=1, help_text='The version of this object (an integer starting from 1)')), - ('short_description', models.CharField(default='', help_text='Describe the object succinctly (try to keep it under 80 characters)', max_length=100, blank=True)), - ('creation_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation date')), - ('hash', models.CharField(help_text='Hashed value of the object contents (<a href="https://docs.python.org/2/library/hashlib.html">SHA256, hexadecimal digest</a>). This field is auto-generated and managed by the platform.', max_length=64, editable=False)), - ('language', models.CharField(default='P', max_length=1, choices=[('U', 'Unknown'), ('', 'Binary'), ('M', 'Matla'), ('P', 'Python'), ('R', 'R')])), - ('declaration_file', models.FileField(db_column='declaration', upload_to=beat.web.common.models.get_contribution_declaration_filename, storage=beat.web.libraries.models.LibraryStorage(), max_length=200, blank=True, null=True)), - ('description_file', models.FileField(db_column='description', upload_to=beat.web.common.models.get_contribution_description_filename, storage=beat.web.libraries.models.LibraryStorage(), max_length=200, blank=True, null=True)), - ('source_code_file', models.FileField(db_column='source_code', upload_to=beat.web.code.models.get_contribution_source_code_filename, storage=beat.web.libraries.models.LibraryStorage(), max_length=200, blank=True, null=True)), - ('author', models.ForeignKey(related_name='librarys', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), - ('fork_of', models.ForeignKey(related_name='forks', blank=True, to='libraries.Library', null=True, on_delete=models.SET_NULL)), - ('previous_version', models.ForeignKey(related_name='next_versions', blank=True, to='libraries.Library', null=True, on_delete=models.SET_NULL)), - ('referenced_libraries', models.ManyToManyField(related_name='referencing', to='libraries.Library', blank=True)), - ('shared_with', models.ManyToManyField(related_name='shared_librarys', to=settings.AUTH_USER_MODEL, blank=True)), - ('shared_with_team', models.ManyToManyField(related_name='shared_librarys', to='team.Team', blank=True)), - ('usable_by', models.ManyToManyField(related_name='usable_librarys', to=settings.AUTH_USER_MODEL, blank=True)), - ('usable_by_team', models.ManyToManyField(related_name='usable_librarys', to='team.Team', blank=True)), + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "sharing", + models.CharField( + default="P", + max_length=1, + choices=[ + ("P", "Private"), + ("S", "Shared"), + ("A", "Public"), + ("U", "Usable"), + ], + ), + ), + ( + "name", + models.CharField( + help_text="The name for this object (space-like characters will be automatically replaced by dashes)", + max_length=200, + ), + ), + ( + "version", + models.PositiveIntegerField( + default=1, + help_text="The version of this object (an integer starting from 1)", + ), + ), + ( + "short_description", + models.CharField( + default="", + help_text="Describe the object succinctly (try to keep it under 80 characters)", + max_length=100, + blank=True, + ), + ), + ( + "creation_date", + models.DateTimeField( + auto_now_add=True, verbose_name="Creation date" + ), + ), + ( + "hash", + models.CharField( + help_text='Hashed value of the object contents (<a href="https://docs.python.org/2/library/hashlib.html">SHA256, hexadecimal digest</a>). This field is auto-generated and managed by the platform.', + max_length=64, + editable=False, + ), + ), + ( + "language", + models.CharField( + default="P", + max_length=1, + choices=[ + ("U", "Unknown"), + ("", "Binary"), + ("M", "Matla"), + ("P", "Python"), + ("R", "R"), + ], + ), + ), + ( + "declaration_file", + models.FileField( + db_column="declaration", + upload_to=beat.web.common.models.get_contribution_declaration_filename, + storage=beat.web.libraries.models.LibraryStorage(), + max_length=200, + blank=True, + null=True, + ), + ), + ( + "description_file", + models.FileField( + db_column="description", + upload_to=beat.web.common.models.get_contribution_description_filename, + storage=beat.web.libraries.models.LibraryStorage(), + max_length=200, + blank=True, + null=True, + ), + ), + ( + "source_code_file", + models.FileField( + db_column="source_code", + upload_to=beat.web.code.models.get_contribution_source_code_filename, + storage=beat.web.libraries.models.LibraryStorage(), + max_length=200, + blank=True, + null=True, + ), + ), + ( + "author", + models.ForeignKey( + related_name="librarys", + to=settings.AUTH_USER_MODEL, + on_delete=models.CASCADE, + ), + ), + ( + "fork_of", + models.ForeignKey( + related_name="forks", + blank=True, + to="libraries.Library", + null=True, + on_delete=models.SET_NULL, + ), + ), + ( + "previous_version", + models.ForeignKey( + related_name="next_versions", + blank=True, + to="libraries.Library", + null=True, + on_delete=models.SET_NULL, + ), + ), + ( + "referenced_libraries", + models.ManyToManyField( + related_name="referencing", to="libraries.Library", blank=True + ), + ), + ( + "shared_with", + models.ManyToManyField( + related_name="shared_librarys", + to=settings.AUTH_USER_MODEL, + blank=True, + ), + ), + ( + "shared_with_team", + models.ManyToManyField( + related_name="shared_librarys", to="team.Team", blank=True + ), + ), + ( + "usable_by", + models.ManyToManyField( + related_name="usable_librarys", + to=settings.AUTH_USER_MODEL, + blank=True, + ), + ), + ( + "usable_by_team", + models.ManyToManyField( + related_name="usable_librarys", to="team.Team", blank=True + ), + ), ], options={ - 'ordering': ['author__username', 'name', 'version'], - 'abstract': False, - 'verbose_name_plural': 'libraries', + "ordering": ["author__username", "name", "version"], + "abstract": False, + "verbose_name_plural": "libraries", }, ), migrations.AlterUniqueTogether( - name='library', - unique_together=set([('author', 'name', 'version')]), + name="library", unique_together=set([("author", "name", "version")]), ), ] diff --git a/beat/web/libraries/migrations/0002_cxx_backend.py b/beat/web/libraries/migrations/0002_cxx_backend.py index a0d8060e6a49bdb06c35fb3c7a0fc7e12053a420..37016332c893a437c6fa55bd1b2c373c6a888866 100644 --- a/beat/web/libraries/migrations/0002_cxx_backend.py +++ b/beat/web/libraries/migrations/0002_cxx_backend.py @@ -2,19 +2,30 @@ # Generated by Django 1.9.11 on 2016-11-09 11:05 from __future__ import unicode_literals -from django.db import migrations, models +from django.db import migrations +from django.db import models class Migration(migrations.Migration): dependencies = [ - ('libraries', '0001_initial'), + ("libraries", "0001_initial"), ] operations = [ migrations.AlterField( - model_name='library', - name='language', - field=models.CharField(choices=[(b'U', b'Unknown'), (b'C', b'C++'), (b'M', b'Matlab'), (b'P', b'Python'), (b'R', b'R')], default=b'P', max_length=1), + model_name="library", + name="language", + field=models.CharField( + choices=[ + (b"U", b"Unknown"), + (b"C", b"C++"), + (b"M", b"Matlab"), + (b"P", b"Python"), + (b"R", b"R"), + ], + default=b"P", + max_length=1, + ), ), ] diff --git a/beat/web/libraries/migrations/0003_auto_20161123_1218.py b/beat/web/libraries/migrations/0003_auto_20161123_1218.py index a9cf143a86ab1482f4e710604bbf88f49ca1b858..97c62a88d2ac9780f2544b4dcbc5e32efa5ab587 100644 --- a/beat/web/libraries/migrations/0003_auto_20161123_1218.py +++ b/beat/web/libraries/migrations/0003_auto_20161123_1218.py @@ -2,19 +2,30 @@ # Generated by Django 1.9.11 on 2016-11-23 12:18 from __future__ import unicode_literals -from django.db import migrations, models +from django.db import migrations +from django.db import models class Migration(migrations.Migration): dependencies = [ - ('libraries', '0002_cxx_backend'), + ("libraries", "0002_cxx_backend"), ] operations = [ migrations.AlterField( - model_name='library', - name='language', - field=models.CharField(choices=[(b'U', b'Unknown'), (b'C', b'Cxx'), (b'M', b'Matlab'), (b'P', b'Python'), (b'R', b'R')], default=b'P', max_length=1), + model_name="library", + name="language", + field=models.CharField( + choices=[ + (b"U", b"Unknown"), + (b"C", b"Cxx"), + (b"M", b"Matlab"), + (b"P", b"Python"), + (b"R", b"R"), + ], + default=b"P", + max_length=1, + ), ), ]