Skip to content

Commit

Permalink
Ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
vpet98 committed Jul 3, 2024
1 parent 4e53fcc commit 3b9a092
Show file tree
Hide file tree
Showing 21 changed files with 1,092 additions and 410 deletions.
28 changes: 21 additions & 7 deletions board/admin.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
from django.contrib import admin

from .models import Fdsn_registry, Consistency, Eida_routing, Datacenter, Datacite, Stationxml
from .models import (
Fdsn_registry,
Consistency,
Eida_routing,
Datacenter,
Datacite,
Stationxml,
)


class Fdsn_registryAdmin(admin.ModelAdmin):
search_fields = ['netcode']
search_fields = ["netcode"]


class DatacenterAdmin(admin.ModelAdmin):
search_fields = ['name']
search_fields = ["name"]


class DataciteAdmin(admin.ModelAdmin):
search_fields = ['network__netcode']
search_fields = ["network__netcode"]


class Eida_routingAdmin(admin.ModelAdmin):
search_fields = ['datacenter__name', 'netcode']
search_fields = ["datacenter__name", "netcode"]


class StationxmlAdmin(admin.ModelAdmin):
search_fields = ['datacenter__name', 'netcode']
search_fields = ["datacenter__name", "netcode"]


class ConsistencyAdmin(admin.ModelAdmin):
search_fields = ['fdsn_net__netcode', 'eidarout_net__netcode', 'xml_net__netcode']
search_fields = ["fdsn_net__netcode", "eidarout_net__netcode", "xml_net__netcode"]


admin.site.register(Fdsn_registry, Fdsn_registryAdmin)
admin.site.register(Consistency, ConsistencyAdmin)
Expand Down
4 changes: 2 additions & 2 deletions board/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class BoardConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'board'
default_auto_field = "django.db.models.BigAutoField"
name = "board"
172 changes: 118 additions & 54 deletions board/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,102 +5,166 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
]
dependencies = []

operations = [
migrations.CreateModel(
name='Datacenter',
name="Datacenter",
fields=[
('name', models.CharField(max_length=30, primary_key=True, serialize=False)),
('station_url', models.CharField(max_length=300, null=True)),
(
"name",
models.CharField(max_length=30, primary_key=True, serialize=False),
),
("station_url", models.CharField(max_length=300, null=True)),
],
),
migrations.CreateModel(
name='Datacite',
name="Datacite",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('licenses', models.CharField(max_length=500, null=True)),
('page', models.CharField(max_length=300, null=True)),
('publisher', models.CharField(max_length=300, null=True)),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("licenses", models.CharField(max_length=500, null=True)),
("page", models.CharField(max_length=300, null=True)),
("publisher", models.CharField(max_length=300, null=True)),
],
),
migrations.CreateModel(
name='Network',
name="Network",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(max_length=10)),
('startdate', models.DateField()),
('enddate', models.DateField(null=True)),
('doi', models.CharField(max_length=100, null=True)),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("code", models.CharField(max_length=10)),
("startdate", models.DateField()),
("enddate", models.DateField(null=True)),
("doi", models.CharField(max_length=100, null=True)),
],
),
migrations.CreateModel(
name='Routing',
name="Routing",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('priority', models.IntegerField(null=True)),
('source', models.CharField(choices=[('EIDA', 'EIDA'), ('FDSN', 'FDSN')], max_length=4, null=True)),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("priority", models.IntegerField(null=True)),
(
"source",
models.CharField(
choices=[("EIDA", "EIDA"), ("FDSN", "FDSN")],
max_length=4,
null=True,
),
),
],
),
migrations.CreateModel(
name='Stationxml',
name="Stationxml",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('doi', models.CharField(max_length=100, null=True)),
('restriction', models.CharField(max_length=50, null=True)),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("doi", models.CharField(max_length=100, null=True)),
("restriction", models.CharField(max_length=50, null=True)),
],
),
migrations.CreateModel(
name='Tests',
name="Tests",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('test_time', models.DateTimeField()),
('doi', models.CharField(max_length=100, null=True)),
('page_works', models.BooleanField(null=True)),
('has_license', models.BooleanField(null=True)),
('xml_doi_match', models.BooleanField(null=True)),
('xml_restriction_match', models.BooleanField(null=True)),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("test_time", models.DateTimeField()),
("doi", models.CharField(max_length=100, null=True)),
("page_works", models.BooleanField(null=True)),
("has_license", models.BooleanField(null=True)),
("xml_doi_match", models.BooleanField(null=True)),
("xml_restriction_match", models.BooleanField(null=True)),
],
),
migrations.AddConstraint(
model_name='network',
constraint=models.UniqueConstraint(fields=('code', 'startdate'), name='unique_combination_network'),
model_name="network",
constraint=models.UniqueConstraint(
fields=("code", "startdate"), name="unique_combination_network"
),
),
migrations.AddField(
model_name='datacite',
name='network',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='board.network'),
model_name="datacite",
name="network",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="board.network"
),
),
migrations.AddField(
model_name='routing',
name='datacenter',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='board.datacenter'),
model_name="routing",
name="datacenter",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="board.datacenter"
),
),
migrations.AddField(
model_name='routing',
name='network',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='board.network'),
model_name="routing",
name="network",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="board.network"
),
),
migrations.AddField(
model_name='stationxml',
name='network',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='board.network'),
model_name="stationxml",
name="network",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="board.network"
),
),
migrations.AddField(
model_name='tests',
name='network',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='board.network'),
model_name="tests",
name="network",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="board.network"
),
),
migrations.AddConstraint(
model_name='routing',
constraint=models.UniqueConstraint(fields=('network', 'datacenter'), name='unique_combination_routing'),
model_name="routing",
constraint=models.UniqueConstraint(
fields=("network", "datacenter"), name="unique_combination_routing"
),
),
migrations.AddConstraint(
model_name='tests',
constraint=models.UniqueConstraint(fields=('test_time', 'network'), name='unique_combination_tests'),
model_name="tests",
constraint=models.UniqueConstraint(
fields=("test_time", "network"), name="unique_combination_tests"
),
),
]
17 changes: 9 additions & 8 deletions board/migrations/0002_rename_tests_test_and_more.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@


class Migration(migrations.Migration):

dependencies = [
('board', '0001_initial'),
("board", "0001_initial"),
]

operations = [
migrations.RenameModel(
old_name='Tests',
new_name='Test',
old_name="Tests",
new_name="Test",
),
migrations.RemoveConstraint(
model_name='test',
name='unique_combination_tests',
model_name="test",
name="unique_combination_tests",
),
migrations.AddConstraint(
model_name='test',
constraint=models.UniqueConstraint(fields=('test_time', 'network'), name='unique_combination_test'),
model_name="test",
constraint=models.UniqueConstraint(
fields=("test_time", "network"), name="unique_combination_test"
),
),
]
Loading

0 comments on commit 3b9a092

Please sign in to comment.