Browse Source

Rename members app to projects

pull/1671/head
Hironsan 2 years ago
parent
commit
66e4b64539
31 changed files with 32 additions and 20 deletions
  1. 2
      backend/api/tests/api/utils.py
  2. 2
      backend/api/views/project.py
  3. 2
      backend/api/views/tag.py
  4. 2
      backend/app/settings.py
  5. 2
      backend/app/urls.py
  6. 2
      backend/auto_labeling/views.py
  7. 2
      backend/data_export/views.py
  8. 2
      backend/data_import/views.py
  9. 2
      backend/examples/views/comment.py
  10. 2
      backend/examples/views/example.py
  11. 2
      backend/examples/views/example_state.py
  12. 2
      backend/label_types/views.py
  13. 2
      backend/labels/views.py
  14. 4
      backend/metrics/views.py
  15. 0
      backend/projects/__init__.py
  16. 0
      backend/projects/admin.py
  17. 6
      backend/projects/apps.py
  18. 0
      backend/projects/exceptions.py
  19. 0
      backend/projects/management/__init__.py
  20. 0
      backend/projects/management/commands/__init__.py
  21. 0
      backend/projects/management/commands/create_member.py
  22. 12
      backend/projects/migrations/0001_initial.py
  23. 0
      backend/projects/migrations/__init__.py
  24. 0
      backend/projects/models.py
  25. 0
      backend/projects/permissions.py
  26. 0
      backend/projects/serializers.py
  27. 0
      backend/projects/signals.py
  28. 2
      backend/projects/tests.py
  29. 0
      backend/projects/urls.py
  30. 0
      backend/projects/views.py
  31. 2
      backend/users/views.py

2
backend/api/tests/api/utils.py

@ -10,7 +10,7 @@ from rest_framework.test import APITestCase
from api.models import (DOCUMENT_CLASSIFICATION, IMAGE_CLASSIFICATION,
INTENT_DETECTION_AND_SLOT_FILLING, SEQ2SEQ,
SEQUENCE_LABELING, SPEECH2TEXT)
from members.models import Member
from projects.models import Member
from roles.models import Role
DATA_DIR = os.path.join(os.path.dirname(__file__), '../../../data_import/tests/data')

2
backend/api/views/project.py

@ -4,7 +4,7 @@ from rest_framework import filters, generics, status
from rest_framework.permissions import IsAdminUser, IsAuthenticated
from rest_framework.response import Response
from members.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
from projects.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
from ..models import Project
from ..serializers import ProjectPolymorphicSerializer

2
backend/api/views/tag.py

@ -1,7 +1,7 @@
from rest_framework import generics
from rest_framework.permissions import IsAuthenticated
from members.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
from projects.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
from ..models import Tag
from ..serializers import TagSerializer

2
backend/app/settings.py

@ -53,7 +53,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
'api.apps.ApiConfig',
'roles.apps.RolesConfig',
'members.apps.MembersConfig',
'projects.apps.ProjectsConfig',
'metrics.apps.MetricsConfig',
'users.apps.UsersConfig',
'data_import.apps.DataImportConfig',

2
backend/app/urls.py

@ -55,7 +55,7 @@ urlpatterns += [
path('v1/', include('users.urls')),
path('v1/', include('data_import.urls')),
path('v1/', include('data_export.urls')),
path('v1/projects/<int:project_id>/', include('members.urls')),
path('v1/projects/<int:project_id>/', include('projects.urls')),
path('v1/projects/<int:project_id>/metrics/', include('metrics.urls')),
path('v1/projects/<int:project_id>/', include('auto_labeling.urls')),
path('v1/projects/<int:project_id>/', include('examples.urls')),

2
backend/auto_labeling/views.py

@ -16,7 +16,7 @@ from rest_framework.response import Response
from rest_framework.views import APIView
from api.models import Project
from members.permissions import IsProjectMember, IsProjectAdmin
from projects.permissions import IsProjectMember, IsProjectAdmin
from .pipeline.execution import execute_pipeline, get_label_collection
from .exceptions import AWSTokenError, SampleDataException, TemplateMappingError, URLConnectionError
from .models import AutoLabelingConfig

2
backend/data_export/views.py

@ -7,7 +7,7 @@ from rest_framework.response import Response
from rest_framework.views import APIView
from api.models import Project
from members.permissions import IsProjectAdmin
from projects.permissions import IsProjectAdmin
from .celery_tasks import export_dataset
from .pipeline.catalog import Options

2
backend/data_import/views.py

@ -10,7 +10,7 @@ from rest_framework.views import APIView
from api.models import Project
from members.permissions import IsProjectAdmin
from projects.permissions import IsProjectAdmin
from .celery_tasks import import_dataset
from .pipeline.catalog import Options

2
backend/examples/views/comment.py

@ -3,7 +3,7 @@ from rest_framework import filters, generics, status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from members.permissions import IsProjectMember
from projects.permissions import IsProjectMember
from examples.models import Comment
from examples.permissions import IsOwnComment
from examples.serializers import CommentSerializer

2
backend/examples/views/example.py

@ -11,7 +11,7 @@ from api.models import Project
from examples.filters import ExampleFilter
from examples.models import Example
from examples.serializers import ExampleSerializer
from members.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
from projects.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
class ExampleList(generics.ListCreateAPIView):

2
backend/examples/views/example_state.py

@ -5,7 +5,7 @@ from rest_framework.permissions import IsAuthenticated
from api.models import Project
from examples.models import Example, ExampleState
from examples.serializers import ExampleStateSerializer
from members.permissions import IsProjectMember
from projects.permissions import IsProjectMember
class ExampleStateList(generics.ListCreateAPIView):

2
backend/label_types/views.py

@ -10,7 +10,7 @@ from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from members.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
from projects.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
from .models import LabelType, CategoryType, SpanType, RelationType
from .exceptions import LabelValidationError
from .serializers import (CategoryTypeSerializer, LabelSerializer,

2
backend/labels/views.py

@ -8,7 +8,7 @@ from rest_framework.response import Response
from api.models import Project
from labels.models import Category, Span, TextLabel, Relation
from members.permissions import IsProjectMember
from projects.permissions import IsProjectMember
from .permissions import CanEditLabel
from .serializers import CategorySerializer, SpanSerializer, TextLabelSerializer, RelationSerializer

4
backend/metrics/views.py

@ -8,8 +8,8 @@ from rest_framework.views import APIView
from examples.models import Example, ExampleState
from label_types.models import LabelType, CategoryType, SpanType
from labels.models import Label, Category, Span
from members.models import Member
from members.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
from projects.models import Member
from projects.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
class ProgressAPI(APIView):

backend/members/__init__.py → backend/projects/__init__.py

backend/members/admin.py → backend/projects/admin.py

backend/members/apps.py → backend/projects/apps.py

@ -4,12 +4,12 @@ from django.apps import AppConfig
from django.db.models.signals import post_save
class MembersConfig(AppConfig):
class ProjectsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'members'
name = 'projects'
def ready(self):
importlib.import_module('members.signals')
importlib.import_module('projects.signals')
from api.models import Project
from .signals import add_administrator_on_project_creation

backend/members/exceptions.py → backend/projects/exceptions.py

backend/members/management/__init__.py → backend/projects/management/__init__.py

backend/members/management/commands/__init__.py → backend/projects/management/commands/__init__.py

backend/members/management/commands/create_member.py → backend/projects/management/commands/create_member.py

backend/members/migrations/0001_initial.py → backend/projects/migrations/0001_initial.py

@ -39,5 +39,17 @@ class Migration(migrations.Migration):
),
],
database_operations=[]
),
migrations.RunSQL(
sql="ALTER TABLE members_member RENAME TO projects_member",
reverse_sql="ALTER TABLE projects_member RENAME TO members_member"
),
migrations.RunSQL(
sql="UPDATE django_content_type SET app_label='projects' WHERE app_label='members'",
reverse_sql="UPDATE django_content_type SET app_label='members' WHERE app_label='projects'"
),
migrations.RunSQL(
sql="UPDATE django_migrations SET app='projects' WHERE app='members'",
reverse_sql="UPDATE django_migrations SET app='members' WHERE app='projects'"
)
]

backend/members/migrations/__init__.py → backend/projects/migrations/__init__.py

backend/members/models.py → backend/projects/models.py

backend/members/permissions.py → backend/projects/permissions.py

backend/members/serializers.py → backend/projects/serializers.py

backend/members/signals.py → backend/projects/signals.py

backend/members/tests.py → backend/projects/tests.py

@ -6,7 +6,7 @@ from rest_framework.reverse import reverse
from model_mommy import mommy
from roles.models import Role
from members.models import Member
from projects.models import Member
from api.tests.api.utils import (CRUDMixin, prepare_project, make_user)

backend/members/urls.py → backend/projects/urls.py

backend/members/views.py → backend/projects/views.py

2
backend/users/views.py

@ -5,7 +5,7 @@ from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from members.permissions import IsProjectAdmin
from projects.permissions import IsProjectAdmin
from .serializers import UserSerializer

Loading…
Cancel
Save