-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remodified APIs and functions for new simplified UX fontman/fontman-d…
- Loading branch information
1 parent
29f2fff
commit 547be58
Showing
16 changed files
with
176 additions
and
266 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
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,19 @@ | ||
""" Language | ||
Languages of fonts. | ||
Created by Lahiru Pathirage <lpsandaruwan@gmail.com> on 15/2/2017 | ||
""" | ||
|
||
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String | ||
|
||
from session import Base | ||
|
||
|
||
class Language(Base): | ||
|
||
__tablename__ = "language" | ||
|
||
tag_id = Column(Integer, primary_key=True) | ||
font_id = Column(Integer, ForeignKey("font.font_id"), nullable=False) | ||
language = Column(String(15), nullable=False) |
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,30 @@ | ||
""" Language service | ||
High level functions to manipulate language table. | ||
""" | ||
|
||
|
||
from model import Language | ||
from session import db_session | ||
|
||
|
||
class LanguageService: | ||
|
||
def add_new(self, tag_id, font_id, language): | ||
new_tag = Language( | ||
tag_id=tag_id, | ||
font_id=font_id, | ||
language=language | ||
) | ||
|
||
db_session.add(new_tag) | ||
db_session.commit() | ||
|
||
return new_tag | ||
|
||
def find_all(self): | ||
db_session.query(Language).all() | ||
|
||
def find_by_font_id(self, font_id): | ||
return db_session.query(Language).filter_by(font_id=font_id) |
Oops, something went wrong.