Skip to content

Commit

Permalink
Merge branch 'master' into 619_ts_strict_with_ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
pavish authored Feb 11, 2022
2 parents 09e71c4 + d010e11 commit bed3144
Show file tree
Hide file tree
Showing 30 changed files with 362 additions and 345 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ docker-compose up

If it's your first time running the application, you'll also need to run database migrations and install Mathesar types and functions:
```
docker exec mathesar_service python manage.py migrate
docker exec -it mathesar_service python install.py
docker exec mathesar_service sh -c "python manage.py migrate && python install.py"
```

You should now have a web server and database server running. Opening `http://localhost:8000` in your browser will open the application. For sample table data, you can create a new table in the UI using the `patents.csv` file found in `/mathesar/tests/data`.
Expand Down
Empty file added mathesar/api/db/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions mathesar/api/db/viewsets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from mathesar.api.db.viewsets.columns import ColumnViewSet # noqa
from mathesar.api.db.viewsets.constraints import ConstraintViewSet # noqa
from mathesar.api.db.viewsets.data_files import DataFileViewSet # noqa
from mathesar.api.db.viewsets.databases import DatabaseViewSet # noqa
from mathesar.api.db.viewsets.records import RecordViewSet # noqa
from mathesar.api.db.viewsets.schemas import SchemaViewSet # noqa
from mathesar.api.db.viewsets.tables import TableViewSet # noqa
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from rest_framework.response import Response

from mathesar.models import Database
from mathesar.api.filters import DatabaseFilter
from mathesar.api.dj_filters import DatabaseFilter
from mathesar.api.pagination import DefaultLimitOffsetPagination

from mathesar.api.serializers.databases import DatabaseSerializer, TypeSerializer
from mathesar.api.serializers.databases import DatabaseSerializer

from db.functions.operations.check_support import get_supported_db_functions
from mathesar.api.serializers.functions import DBFunctionSerializer
Expand All @@ -26,12 +26,6 @@ class DatabaseViewSet(viewsets.GenericViewSet, ListModelMixin, RetrieveModelMixi
def get_queryset(self):
return Database.objects.all().order_by('-created_at')

@action(methods=['get'], detail=True)
def types(self, request, pk=None):
database = self.get_object()
serializer = TypeSerializer(database.supported_types, many=True)
return Response(serializer.data)

@action(methods=['get'], detail=True)
def functions(self, request, pk=None):
database = self.get_object()
Expand All @@ -41,7 +35,7 @@ def functions(self, request, pk=None):
return Response(serializer.data)

@action(methods=['get'], detail=True)
def db_types(self, request, pk=None):
def types(self, request, pk=None):
database = self.get_object()
engine = database._sa_engine
available_known_db_types = get_available_known_db_types(engine)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin
from rest_framework.response import Response

from mathesar.api.filters import SchemaFilter
from mathesar.api.dj_filters import SchemaFilter
from mathesar.api.pagination import DefaultLimitOffsetPagination
from mathesar.api.serializers.schemas import SchemaSerializer
from mathesar.models import Schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)
from mathesar.api.exceptions.generic_exceptions import base_exceptions as base_api_exceptions
from db.types.exceptions import UnsupportedTypeException
from mathesar.api.filters import TableFilter
from mathesar.api.dj_filters import TableFilter
from mathesar.api.pagination import DefaultLimitOffsetPagination
from mathesar.api.serializers.tables import TableSerializer, TablePreviewSerializer
from mathesar.models import Table
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mathesar/api/serializers/databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from rest_framework import serializers

from mathesar.api.display_options import DISPLAY_OPTIONS_BY_TYPE_IDENTIFIER
from mathesar.api.dj_filters import FILTER_OPTIONS_BY_TYPE_IDENTIFIER
from mathesar.api.exceptions.mixins import MathesarErrorMessageMixin
from mathesar.api.filters import FILTER_OPTIONS_BY_TYPE_IDENTIFIER
from mathesar.models import Database


Expand Down
Empty file added mathesar/api/ui/__init__.py
Empty file.
1 change: 1 addition & 0 deletions mathesar/api/ui/viewsets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from mathesar.api.ui.viewsets.databases import DatabaseViewSet # noqa
27 changes: 27 additions & 0 deletions mathesar/api/ui/viewsets/databases.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from django_filters import rest_framework as filters
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin
from rest_framework.response import Response

from mathesar.models import Database
from mathesar.api.dj_filters import DatabaseFilter
from mathesar.api.pagination import DefaultLimitOffsetPagination

from mathesar.api.serializers.databases import DatabaseSerializer, TypeSerializer


class DatabaseViewSet(viewsets.GenericViewSet, ListModelMixin, RetrieveModelMixin):
serializer_class = DatabaseSerializer
pagination_class = DefaultLimitOffsetPagination
filter_backends = (filters.DjangoFilterBackend,)
filterset_class = DatabaseFilter

def get_queryset(self):
return Database.objects.all().order_by('-created_at')

@action(methods=['get'], detail=True)
def types(self, request, pk=None):
database = self.get_object()
serializer = TypeSerializer(database.supported_types, many=True)
return Response(serializer.data)
7 changes: 0 additions & 7 deletions mathesar/api/viewsets/__init__.py

This file was deleted.

Loading

0 comments on commit bed3144

Please sign in to comment.