-
Notifications
You must be signed in to change notification settings - Fork 52
Feature/HebrewView #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
elor555
wants to merge
71
commits into
PythonFreeCourse:develop
Choose a base branch
from
elor555:feature/hebrewview
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/HebrewView #280
Changes from 32 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
33723a7
add hebrew dates to calendar-nre feature
elor555 0d296f3
add test to hebrew dates
elor555 970534d
edit flake8
elor555 f0bc588
edit flake8
elor555 7282e00
fix after pull
elor555 861587a
edit flake8
elor555 8426167
edit
elor555 6b28e84
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 fbdd7f5
edit
elor555 442a640
edit
elor555 e4720c8
check
elor555 fcefcbe
check
elor555 9e6742e
edit
elor555 c63471a
edit
elor555 97a1d8c
edit after flake8
elor555 201b1d8
edit after flake8
elor555 739729e
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 d79b1c3
edit after flake8
elor555 f488161
edit after flake8
elor555 3d2c150
edit after flake8
elor555 d873fd6
edit after flake8
elor555 7593c11
edit after pull
elor555 3dd122b
edit after pull
elor555 b06b7be
edit after pull
elor555 4dd3ac5
edit
elor555 6c2d65c
edit
elor555 f6b8607
edit
elor555 3c70a58
edit
elor555 6a34a33
edit
elor555 822ac9d
edit
elor555 0ae1726
edit
elor555 9e9ee25
edit
elor555 0a8b157
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 ac73386
edit
elor555 426da0a
edit
elor555 63c437a
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 4ae0595
edit
elor555 f2323d6
edit
elor555 9fd7cbc
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 1c52fbd
edit
elor555 0abd915
edit
elor555 ad7ea1a
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 78278bc
edit
elor555 e8c1776
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 d2573b1
edit
elor555 d6b58f0
edit
elor555 7af9582
edit
elor555 a3b0b95
edit
elor555 be3ce04
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 408de5d
edit
elor555 848368f
edit
elor555 3e96b8b
edit
elor555 34ebe6e
edit
elor555 4fa9da5
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 a64fcd9
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 3b1a6be
Details Message
elor555 ed58474
Details Message
elor555 22f0bcc
fix: flake8
elor555 1a1eb3d
fix: flake8
elor555 7d6ec9b
fix: bug fix
elor555 18a0195
fix: bug fix
elor555 c022096
fix: bug fix
elor555 44f9d61
fix: fix translation files
elor555 76726e1
Merge remote-tracking branch 'upstream/develop' into feature/hebrewview
elor555 a2449d2
fix: bugfix
elor555 c7d3b7d
fix: bugfix
elor555 11fc0d6
fix: bugfix
elor555 377e82d
fix: bugfix
elor555 9b0c629
fix: styling
elor555 0a9a4fb
fix: bugfix
elor555 c48a270
fix: bugfix
elor555 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,34 @@ | ||
from datetime import datetime | ||
from typing import Dict, Optional | ||
|
||
from app.database.models import HebrewView | ||
from sqlalchemy.orm import Session | ||
|
||
|
||
def create_hebrew_dates_object( | ||
hebrew_dates_fields: Dict[str, Optional[str]])\ | ||
-> HebrewView: | ||
"""This function create a hebrew date object | ||
from given fields dictionary. | ||
It is used for adding the data from the json into the db""" | ||
return HebrewView( | ||
elor555 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
date=datetime.strptime( | ||
hebrew_dates_fields['date_gregorian'], | ||
'%Y-%m-%d').date(), | ||
hebrew_date=hebrew_dates_fields['date_hebrew'] | ||
) | ||
|
||
|
||
def get_hebrew_date_object(session: Session, date: datetime) -> HebrewView: | ||
"""Returns the HebrewView object for the specific day. | ||
|
||
Args: | ||
session: The database connection. | ||
date: The requested date. | ||
|
||
Returns: | ||
A HebrewView object. | ||
""" | ||
for hebrew in session.query(HebrewView).all(): | ||
if hebrew.date == date: | ||
return hebrew |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.