-
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.
update employment skills and refactor
- Loading branch information
Showing
25 changed files
with
530 additions
and
109 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
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
from .base_model import BaseModel, db | ||
|
||
|
||
class SkillsCategory(BaseModel): | ||
class SkillCategory(BaseModel): | ||
|
||
__tablename__ = "skill_categories" | ||
|
||
name = db.Column(db.String(100), nullable=False) | ||
help = db.Column(db.Text(), nullable=True) | ||
is_active = db.Column(db.Boolean, default=True, nullable=True) | ||
is_deleted = db.Column(db.Boolean, default=False, nullable=True) | ||
skills = db.relationship("Skill", backref="skill_categories", lazy=True) |
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,15 @@ | ||
from app.repositories.base_repo import BaseRepo | ||
from app.models.skill_category import SkillCategory | ||
|
||
|
||
class SkillCategoryRepo(BaseRepo): | ||
def __init__(self): | ||
BaseRepo.__init__(self, SkillCategory) | ||
|
||
def new_skill_category(self, name, help_=None, is_active=True, is_deleted=False): | ||
skills_category = SkillCategory( | ||
name=name, help=help_, is_active=is_active, is_deleted=is_deleted | ||
) | ||
|
||
skills_category.save() | ||
return skills_category |
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,18 @@ | ||
from app.repositories.base_repo import BaseRepo | ||
from app.models.skill import Skill | ||
|
||
|
||
class SkillRepo(BaseRepo): | ||
def __init__(self): | ||
BaseRepo.__init__(self, Skill) | ||
|
||
def new_skill(self, name, skill_category_id, is_active=True, is_deleted=False): | ||
new_skill = Skill( | ||
name=name, | ||
skill_category_id=skill_category_id, | ||
is_active=is_active, | ||
is_deleted=is_deleted, | ||
) | ||
|
||
new_skill.save() | ||
return new_skill |
Oops, something went wrong.