Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: change names #3

Merged
merged 1 commit into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions dandi/publish/migrations/0007_deconstructable_file_field.py

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion dandi/publish/admin.py → dandiapi/api/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib import admin

from dandi.publish.models import Asset, Dandiset, DraftVersion, Version
from dandiapi.api.models import Asset, Dandiset, DraftVersion, Version


@admin.register(Dandiset)
Expand Down
2 changes: 1 addition & 1 deletion dandi/publish/apps.py → dandiapi/api/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class PublishConfig(AppConfig):
name = 'dandi.publish'
name = 'dandiapi.api'
verbose_name = 'DANDI: Publish'
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from django.db import migrations, models
import django.db.models.deletion

import dandi.publish.models
import dandi.publish.storage
import dandiapi.api.models
import dandiapi.api.storage


class Migration(migrations.Migration):
Expand Down Expand Up @@ -51,7 +51,7 @@ class Migration(migrations.Migration):
(
'version',
models.CharField(
default=dandi.publish.models.version._get_default_version,
default=dandiapi.api.models.version._get_default_version,
max_length=13,
validators=[django.core.validators.RegexValidator('^0\\.\\d{6}\\.\\d{4}$')],
),
Expand All @@ -67,7 +67,7 @@ class Migration(migrations.Migration):
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='versions',
to='publish.Dandiset',
to='api.Dandiset',
),
),
],
Expand Down Expand Up @@ -100,10 +100,10 @@ class Migration(migrations.Migration):
'blob',
models.FileField(
blank=True,
storage=dandi.publish.storage.create_s3_storage(
storage=dandiapi.api.storage.create_s3_storage(
settings.DANDI_DANDISETS_BUCKET_NAME
),
upload_to=dandi.publish.models.asset._get_asset_blob_prefix,
upload_to=dandiapi.api.models.asset._get_asset_blob_prefix,
),
),
('created', models.DateTimeField(auto_now_add=True)),
Expand All @@ -113,7 +113,7 @@ class Migration(migrations.Migration):
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='assets',
to='publish.Version',
to='api.Version',
),
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('publish', '0001_initial'),
('api', '0001_initial'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('publish', '0002_alter_version_meta'),
('api', '0002_alter_version_meta'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('publish', '0003_asset_ordering'),
('api', '0003_asset_ordering'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('publish', '0004_auto_20200722_1718'),
('api', '0004_auto_20200722_1718'),
]

operations = [
Expand All @@ -20,7 +20,7 @@ class Migration(migrations.Migration):
on_delete=django.db.models.deletion.CASCADE,
primary_key=True,
serialize=False,
to='publish.Dandiset',
to='api.Dandiset',
),
),
('name', models.CharField(max_length=150)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


def populate_drafts(apps, schema_editor):
Dandiset = apps.get_model('publish', 'Dandiset') # noqa: N806
DraftVersion = apps.get_model('publish', 'DraftVersion') # noqa: N806
Dandiset = apps.get_model('api', 'Dandiset') # noqa: N806
DraftVersion = apps.get_model('api', 'DraftVersion') # noqa: N806

for dandiset in Dandiset.objects.all():
try:
Expand All @@ -24,7 +24,7 @@ def populate_drafts(apps, schema_editor):
class Migration(migrations.Migration):

dependencies = [
('publish', '0005_add_drafts_model'),
('api', '0005_add_drafts_model'),
]

operations = [
Expand Down
23 changes: 23 additions & 0 deletions dandiapi/api/migrations/0007_deconstructable_file_field.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from django.db import migrations

import dandiapi.api.models.asset
import dandiapi.api.storage


class Migration(migrations.Migration):

dependencies = [
('api', '0006_populate_drafts_from_versions'),
]

operations = [
migrations.AlterField(
model_name='asset',
name='blob',
field=dandiapi.api.storage.DeconstructableFileField(
blank=True,
storage=dandiapi.api.models.asset._get_asset_blob_storage,
upload_to=dandiapi.api.models.asset._get_asset_blob_prefix,
),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('publish', '0007_deconstructable_file_field'),
('api', '0007_deconstructable_file_field'),
]

operations = [
Expand All @@ -19,7 +19,7 @@ class Migration(migrations.Migration):
primary_key=True,
related_name='draft_version',
serialize=False,
to='publish.Dandiset',
to='api.Dandiset',
),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('publish', '0008_draft_version_related_name'),
('api', '0008_draft_version_related_name'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('publish', '0008_draft_version_related_name'),
('api', '0008_draft_version_related_name'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('publish', '0009_rename_modified'),
('api', '0009_rename_modified'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class Migration(migrations.Migration):

dependencies = [
('publish', '0010_timestampedmodel'),
('publish', '0009_remove_description'),
('api', '0010_timestampedmodel'),
('api', '0009_remove_description'),
]

operations = []
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from django.db.models import Sum
from django_extensions.db.models import TimeStampedModel

from dandi.publish.girder import GirderClient, GirderFile
from dandi.publish.storage import DeconstructableFileField, create_s3_storage
from dandiapi.api.girder import GirderClient, GirderFile
from dandiapi.api.storage import DeconstructableFileField, create_s3_storage

from .version import Version

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.db import models
from django_extensions.db.models import TimeStampedModel

from dandi.publish.girder import GirderClient, GirderError
from dandiapi.api.girder import GirderClient, GirderError

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from django.db import models
from django_extensions.db.models import TimeStampedModel

from dandi.publish.girder import GirderClient
from dandiapi.api.girder import GirderClient

from .common import SelectRelatedManager
from .dandiset import Dandiset
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions dandi/publish/tasks.py → dandiapi/api/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from celery.utils.log import get_task_logger
from django.db.transaction import atomic

from dandi.publish.girder import GirderClient
from dandi.publish.models import Asset, Dandiset, Version
from dandiapi.api.girder import GirderClient
from dandiapi.api.models import Asset, Dandiset, Version

logger = get_task_logger(__name__)

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib.auth.models import User
import factory.django

from dandi.publish.models import Asset, Dandiset, DraftVersion, Version
from dandiapi.api.models import Asset, Dandiset, DraftVersion, Version


class UserFactory(factory.django.DjangoModelFactory):
Expand All @@ -24,7 +24,7 @@ class Meta:
# DandisetFactory. This will call DraftVersionFactory(dandiset=our_new_dandiset), thus skipping
# the SubFactory.
draft_version = factory.RelatedFactory(
'dandi.publish.tests.factories.DraftVersionFactory', factory_related_name='dandiset'
'dandiapi.api.tests.factories.DraftVersionFactory', factory_related_name='dandiset'
)


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import factory

from dandi.publish.girder import GirderClient, GirderFile
from dandiapi.api.girder import GirderClient, GirderFile


class _GirderClientFolderFactory(factory.DictFactory):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from dandi.publish.models import Asset
from dandiapi.api.models import Asset

from .fuzzy import TIMESTAMP_RE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from dandi.publish.models import Dandiset
from dandiapi.api.models import Dandiset

from .fuzzy import TIMESTAMP_RE

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.core.exceptions import ValidationError
import pytest

from dandi.publish.models import Version
from dandiapi.api.models import Version

from .fuzzy import TIMESTAMP_RE

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions dandi/publish/views/asset.py → dandiapi/api/views/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from rest_framework.viewsets import ReadOnlyModelViewSet
from rest_framework_extensions.mixins import NestedViewSetMixin

from dandi.publish.models import Asset
from dandi.publish.views.common import DandiPagination
from dandi.publish.views.version import VersionSerializer
from dandiapi.api.models import Asset
from dandiapi.api.views.common import DandiPagination
from dandiapi.api.views.version import VersionSerializer


class AssetSerializer(serializers.ModelSerializer):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from rest_framework.response import Response
from rest_framework.viewsets import ReadOnlyModelViewSet

from dandi.publish.girder import GirderClient
from dandi.publish.models import Dandiset
from dandi.publish.views.common import DandiPagination
from dandiapi.api.girder import GirderClient
from dandiapi.api.models import Dandiset
from dandiapi.api.views.common import DandiPagination


class DandisetSerializer(serializers.ModelSerializer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from rest_framework.decorators import api_view
from rest_framework.response import Response

from dandi.publish.models import Asset, Dandiset
from dandiapi.api.models import Asset, Dandiset


@api_view()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from rest_framework.viewsets import ReadOnlyModelViewSet
from rest_framework_extensions.mixins import DetailSerializerMixin, NestedViewSetMixin

from dandi.publish.models import Dandiset, Version
from dandi.publish.tasks import publish_version
from dandi.publish.views.common import DandiPagination
from dandi.publish.views.dandiset import DandisetSerializer
from dandiapi.api.models import Dandiset, Version
from dandiapi.api.tasks import publish_version
from dandiapi.api.views.common import DandiPagination
from dandiapi.api.views.dandiset import DandisetSerializer


class VersionSerializer(serializers.ModelSerializer):
Expand Down
2 changes: 1 addition & 1 deletion dandi/asgi.py → dandiapi/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import configurations.importer
from django.core.asgi import get_asgi_application

os.environ['DJANGO_SETTINGS_MODULE'] = 'dandi.settings'
os.environ['DJANGO_SETTINGS_MODULE'] = 'dandiapi.settings'
if not os.environ.get('DJANGO_CONFIGURATION'):
raise ValueError('The environment variable "DJANGO_CONFIGURATION" must be set.')
configurations.importer.install()
Expand Down
2 changes: 1 addition & 1 deletion dandi/celery.py → dandiapi/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from celery import Celery
import configurations.importer

os.environ['DJANGO_SETTINGS_MODULE'] = 'dandi.settings'
os.environ['DJANGO_SETTINGS_MODULE'] = 'dandiapi.settings'
if not os.environ.get('DJANGO_CONFIGURATION'):
raise ValueError('The environment variable "DJANGO_CONFIGURATION" must be set.')
configurations.importer.install()
Expand Down
Loading