-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71525c4
commit 6f1ddd8
Showing
5 changed files
with
27 additions
and
1 deletion.
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
File renamed without changes.
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,5 @@ | ||
<script> | ||
var imageId = {{ object.pk }}; | ||
</script> | ||
|
||
{% include 'django_large_image/_include/imageViewer.html' %} |
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 |
---|---|---|
@@ -1,9 +1,18 @@ | ||
from django.urls import path | ||
from rest_framework.routers import SimpleRouter | ||
|
||
from example.core import views | ||
from example.core.viewsets import ImageFileDetailView, S3ImageFileDetailView | ||
|
||
router = SimpleRouter(trailing_slash=False) | ||
router.register(r'api/large_image', ImageFileDetailView, basename='large-image') | ||
router.register(r'api/large_image/s3', S3ImageFileDetailView, basename='large-image-s3') | ||
|
||
urlpatterns = [] + router.urls | ||
urlpatterns = [ | ||
path('large_image/<int:pk>/', views.ImageFileDetailView.as_view(), name='image-file-detail'), | ||
path( | ||
'large_image/s3/<int:pk>/', | ||
views.S3ImageFileDetailView.as_view(), | ||
name='s3-image-file-detail', | ||
), | ||
] + 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,11 @@ | ||
from django.views.generic import DetailView | ||
|
||
from example.core import models | ||
|
||
|
||
class ImageFileDetailView(DetailView): | ||
model = models.ImageFile | ||
|
||
|
||
class S3ImageFileDetailView(DetailView): | ||
model = models.S3ImageFile |