Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Bülleten
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aaron Dewes
AlekSIS-App-Bülleten
Commits
b657d788
Unverified
Commit
b657d788
authored
2 years ago
by
Dominik George
Browse files
Options
Downloads
Patches
Plain Diff
Implement get_public_url for some slide types
parent
b4307f74
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/buelleten/models/base.py
+3
-0
3 additions, 0 deletions
aleksis/apps/buelleten/models/base.py
aleksis/apps/buelleten/models/slides.py
+6
-0
6 additions, 0 deletions
aleksis/apps/buelleten/models/slides.py
with
9 additions
and
0 deletions
aleksis/apps/buelleten/models/base.py
+
3
−
0
View file @
b657d788
...
...
@@ -44,3 +44,6 @@ class Slide(PolymorphicModel, PureDjangoModel):
@classmethod
def
display_supported
(
cls
,
display
):
return
display
.
profile
in
cls
.
_supported_profiles
def
get_public_url
(
self
,
display
=
None
):
raise
NotImplementedError
(
"
Slide types need to implement the get_public_url method.
"
)
This diff is collapsed.
Click to expand it.
aleksis/apps/buelleten/models/slides.py
+
6
−
0
View file @
b657d788
...
...
@@ -13,6 +13,9 @@ class ForeignURLSlide(Slide):
url
=
models
.
URLField
(
max_length
=
255
,
verbose_name
=
_
(
"
URL
"
))
def
get_public_url
(
self
,
display
=
None
):
return
self
.
url
class
UploadedFileSlide
(
Slide
):
...
...
@@ -43,6 +46,9 @@ class UploadedFileSlide(Slide):
validators
=
[
FileExtensionValidator
(
allowed_extensions
=
TYPES
)],
)
def
get_public_url
(
self
,
display
=
None
):
return
self
.
file
.
url
class
StaticContentSlide
(
Slide
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment