Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
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
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
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
AlekSIS®
Official
AlekSIS-Core
Commits
6021f09c
Commit
6021f09c
authored
3 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Create basic extensible iCal feeds
parent
1367b8fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!975
Resolve "Add possibility to create Ical feeds for all apps"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/core/feeds.py
+38
-0
38 additions, 0 deletions
aleksis/core/feeds.py
pyproject.toml
+1
-0
1 addition, 0 deletions
pyproject.toml
with
39 additions
and
0 deletions
aleksis/core/feeds.py
0 → 100644
+
38
−
0
View file @
6021f09c
from
typing
import
Any
from
django.conf
import
settings
from
django.core.handlers.wsgi
import
WSGIRequest
from
django.utils.functional
import
classproperty
from
django_ical.views
import
ICalFeed
from
aleksis.core.util.core_helpers
import
get_site_preferences
class
PersonalICalFeedBase
(
ICalFeed
):
@property
def
product_id
(
self
):
lang
=
self
.
request
.
LANGUAGE_CODE
return
f
"
-//AlekSIS®//
{
get_site_preferences
()[
'
general__title
'
]
}
//
{
lang
}
"
link
=
settings
.
BASE_URL
timezone
=
settings
.
TIME_ZONE
person
=
None
request
=
None
def
get_object
(
self
,
request
:
WSGIRequest
,
*
args
:
Any
,
**
kwargs
:
Any
)
->
None
:
if
kwargs
.
get
(
"
person
"
):
self
.
person
=
kwargs
.
pop
(
"
person
"
)
self
.
request
=
request
return
super
().
get_object
(
request
,
*
args
,
**
kwargs
)
@classproperty
def
subclasses_list
(
cls
):
return
cls
.
__subclasses__
()
@classproperty
def
subclasses_dict
(
cls
):
return
{
subclass
.
__name__
:
subclass
for
subclass
in
cls
.
subclasses_list
}
@classproperty
def
subclass_choices
(
cls
):
return
[(
subclass
.
__name__
,
f
"
{
subclass
.
title
}
–
{
subclass
.
description
}
"
)
for
subclass
in
cls
.
subclasses_list
]
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
0
View file @
6021f09c
...
...
@@ -126,6 +126,7 @@ python-gnupg = "^0.4.7"
sentry-sdk
=
{
version
=
"^1.4.3"
,
optional
=
true
}
django-cte
=
"^1.1.5"
pycountry
=
"^22.0.0"
django-ical
=
"^1.8.3"
django-iconify
=
"^0.1.0"
customidenticon
=
"^0.1.5"
...
...
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