-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #786 from aaxelb/eng-2650--nonbroken-web-ui
[ENG-2650] give the frontend enough to display something useful for each suid
- Loading branch information
Showing
17 changed files
with
150 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from share import models | ||
|
||
from api.base import ShareSerializer | ||
from api.fields import ShareIdentityField | ||
|
||
|
||
class FormattedMetadataRecordSerializer(ShareSerializer): | ||
# link to self | ||
url = ShareIdentityField(view_name='api:formattedmetadatarecord-detail') | ||
|
||
class Meta: | ||
model = models.FormattedMetadataRecord | ||
fields = ( | ||
'suid', | ||
'record_format', | ||
'date_modified', | ||
'formatted_metadata', | ||
'url', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from rest_framework.routers import SimpleRouter | ||
from api.formattedmetadatarecords import views | ||
|
||
|
||
router = SimpleRouter() | ||
router.register(r'formattedmetadatarecords', views.FormattedMetadataRecordViewSet, base_name='formattedmetadatarecord') | ||
urlpatterns = router.urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from rest_framework import viewsets | ||
|
||
from api.formattedmetadatarecords.serializers import FormattedMetadataRecordSerializer | ||
from api.base import ShareViewSet | ||
|
||
from share.models import FormattedMetadataRecord | ||
|
||
|
||
class FormattedMetadataRecordViewSet(ShareViewSet, viewsets.ReadOnlyModelViewSet): | ||
serializer_class = FormattedMetadataRecordSerializer | ||
|
||
ordering = ('id', ) | ||
|
||
def get_queryset(self): | ||
return FormattedMetadataRecord.objects.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from rest_framework.routers import SimpleRouter | ||
from api.sourceconfigs import views | ||
|
||
|
||
router = SimpleRouter() | ||
router.register(r'sourceconfigs', views.SourceConfigViewSet, base_name='sourceconfig') | ||
urlpatterns = router.urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from rest_framework import viewsets | ||
|
||
from api.sourceconfigs.serializers import SourceConfigSerializer | ||
from api.base import ShareViewSet | ||
|
||
from share.models import SourceConfig | ||
|
||
|
||
class SourceConfigViewSet(ShareViewSet, viewsets.ReadOnlyModelViewSet): | ||
serializer_class = SourceConfigSerializer | ||
|
||
ordering = ('id', ) | ||
|
||
def get_queryset(self): | ||
return SourceConfig.objects.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from share import models | ||
|
||
from api.base import ShareSerializer | ||
from api.fields import ShareIdentityField | ||
from api.sourceconfigs.serializers import SourceConfigSerializer | ||
from api.formattedmetadatarecords.serializers import FormattedMetadataRecordSerializer | ||
|
||
|
||
class SuidSerializer(ShareSerializer): | ||
included_serializers = { | ||
'source_config': SourceConfigSerializer, | ||
'formattedmetadatarecord_set': FormattedMetadataRecordSerializer, | ||
} | ||
|
||
# link to self | ||
url = ShareIdentityField(view_name='api:suid-detail') | ||
|
||
class Meta: | ||
model = models.SourceUniqueIdentifier | ||
fields = ( | ||
'identifier', | ||
'source_config', | ||
'url', | ||
'formattedmetadatarecord_set', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from rest_framework.routers import SimpleRouter | ||
from api.suids import views | ||
|
||
|
||
router = SimpleRouter() | ||
router.register(r'suids', views.SuidViewSet, base_name='suid') | ||
urlpatterns = router.urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from rest_framework import viewsets | ||
|
||
from api.suids.serializers import SuidSerializer | ||
from api.base import ShareViewSet | ||
|
||
from share.models import SourceUniqueIdentifier | ||
|
||
|
||
class SuidViewSet(ShareViewSet, viewsets.ReadOnlyModelViewSet): | ||
serializer_class = SuidSerializer | ||
|
||
ordering = ('id', ) | ||
|
||
def get_queryset(self): | ||
return SourceUniqueIdentifier.objects.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters