This repository has been archived by the owner on Dec 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: share selection; ics for sport and selection
- Loading branch information
1 parent
e7cb6ac
commit dac6a59
Showing
12 changed files
with
282 additions
and
12 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import datetime | ||
|
||
import icalendar | ||
|
||
TIMEZONE = "Europe/Moscow" | ||
|
||
|
||
def get_base_calendar() -> icalendar.Calendar: | ||
""" | ||
Get base calendar with default properties (version, prodid, etc.) | ||
:return: base calendar | ||
:rtype: icalendar.Calendar | ||
""" | ||
|
||
calendar = icalendar.Calendar( | ||
prodid="-//one-zero-eight//Календарь Спорта РФ", | ||
version="2.0", | ||
method="PUBLISH", | ||
) | ||
|
||
calendar["x-wr-caldesc"] = "Календарь Спорта РФ" | ||
calendar["x-wr-timezone"] = TIMEZONE | ||
# | ||
# add timezone | ||
timezone = icalendar.Timezone(tzid=TIMEZONE) | ||
timezone["x-lic-location"] = TIMEZONE | ||
# add standard timezone | ||
standard = icalendar.TimezoneStandard() | ||
standard.add("tzoffsetfrom", datetime.timedelta(hours=3)) | ||
standard.add("tzoffsetto", datetime.timedelta(hours=3)) | ||
standard.add("tzname", "MSK") | ||
standard.add("dtstart", datetime.datetime(1970, 1, 1)) | ||
timezone.add_component(standard) | ||
calendar.add_component(timezone) | ||
|
||
return calendar |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from src.modules.events.schemas import Filters, Sort | ||
from src.pydantic_base import BaseSchema | ||
from src.storages.mongo.__base__ import CustomDocument | ||
|
||
|
||
class SelectionSchema(BaseSchema): | ||
filters: Filters | ||
"Filter for the selection." | ||
sort: Sort = Sort() | ||
"Sort for the selection." | ||
|
||
|
||
class Selection(SelectionSchema, CustomDocument): | ||
pass |
Oops, something went wrong.