Commit 85f2b19d authored by Samuel GAIST's avatar Samuel GAIST Committed by Flavio TARSETTI
Browse files

[toolchains][migrations] Pre-commit cleanup

parent b407b252
...@@ -27,46 +27,163 @@ ...@@ -27,46 +27,163 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings from django.conf import settings
import beat.web.toolchains.models from django.db import migrations
from django.db import models
import beat.web.common.models import beat.web.common.models
import beat.web.toolchains.models
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL), migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('team', '0001_initial'), ("team", "0001_initial"),
] ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='Toolchain', name="Toolchain",
fields=[ 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')])), "id",
('name', models.CharField(help_text='The name for this object (space-like characters will be automatically replaced by dashes)', max_length=200)), models.AutoField(
('version', models.PositiveIntegerField(default=1, help_text='The version of this object (an integer starting from 1)')), verbose_name="ID",
('short_description', models.CharField(default='', help_text='Describe the object succinctly (try to keep it under 80 characters)', max_length=100, blank=True)), serialize=False,
('creation_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation date')), auto_created=True,
('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)), primary_key=True,
('declaration_file', models.FileField(db_column='declaration', upload_to=beat.web.common.models.get_contribution_declaration_filename, storage=beat.web.toolchains.models.ToolchainStorage(), 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.toolchains.models.ToolchainStorage(), max_length=200, blank=True, null=True)), ),
('errors', models.TextField(help_text='Errors detected while validating the toolchain. Automatically set by the platform.', null=True, blank=True)), (
('author', models.ForeignKey(related_name='toolchains', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), "sharing",
('fork_of', models.ForeignKey(related_name='forks', blank=True, to='toolchains.Toolchain', null=True, on_delete=models.SET_NULL)), models.CharField(
('previous_version', models.ForeignKey(related_name='next_versions', blank=True, to='toolchains.Toolchain', null=True, on_delete=models.SET_NULL)), default="P",
('shared_with', models.ManyToManyField(related_name='shared_toolchains', to=settings.AUTH_USER_MODEL, blank=True)), max_length=1,
('shared_with_team', models.ManyToManyField(related_name='shared_toolchains', to='team.Team', blank=True)), 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,
),
),
(
"declaration_file",
models.FileField(
db_column="declaration",
upload_to=beat.web.common.models.get_contribution_declaration_filename,
storage=beat.web.toolchains.models.ToolchainStorage(),
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.toolchains.models.ToolchainStorage(),
max_length=200,
blank=True,
null=True,
),
),
(
"errors",
models.TextField(
help_text="Errors detected while validating the toolchain. Automatically set by the platform.",
null=True,
blank=True,
),
),
(
"author",
models.ForeignKey(
related_name="toolchains",
to=settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
),
),
(
"fork_of",
models.ForeignKey(
related_name="forks",
blank=True,
to="toolchains.Toolchain",
null=True,
on_delete=models.SET_NULL,
),
),
(
"previous_version",
models.ForeignKey(
related_name="next_versions",
blank=True,
to="toolchains.Toolchain",
null=True,
on_delete=models.SET_NULL,
),
),
(
"shared_with",
models.ManyToManyField(
related_name="shared_toolchains",
to=settings.AUTH_USER_MODEL,
blank=True,
),
),
(
"shared_with_team",
models.ManyToManyField(
related_name="shared_toolchains", to="team.Team", blank=True
),
),
], ],
options={ options={
'ordering': ['author__username', 'name', 'version'], "ordering": ["author__username", "name", "version"],
'abstract': False, "abstract": False,
}, },
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(
name='toolchain', name="toolchain", unique_together=set([("author", "name", "version")]),
unique_together=set([('author', 'name', 'version')]),
), ),
] ]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment