-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from cuappdev/master
Merge
- Loading branch information
Showing
18 changed files
with
378 additions
and
120 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
repos: | ||
- repo: https://github.com/ambv/black | ||
rev: stable | ||
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 24.8.0 | ||
hooks: | ||
- id: black | ||
language_version: python3.7 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v1.2.3 | ||
- id: black | ||
# It is recommended to specify the latest version of Python | ||
# supported by your project here, or alternatively use | ||
# pre-commit's default_language_version, see | ||
# https://pre-commit.com/#top_level-default_language_version | ||
language_version: python3.9 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.6.3 | ||
hooks: | ||
- id: flake8 | ||
# Run the linter. | ||
- id: ruff | ||
args: [--fix] | ||
- repo: https://github.com/PyCQA/bandit | ||
rev: 1.7.0 | ||
hooks: | ||
- id: bandit |
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,40 +1,39 @@ | ||
import enum | ||
from sqlalchemy import Column, String, Enum, Integer, ForeignKey | ||
from sqlalchemy.orm import relationship | ||
from src.database import Base | ||
|
||
|
||
class EquipmentType(enum.Enum): | ||
|
||
cardio = 0 | ||
racks_and_benches = 1 | ||
selectorized = 2 | ||
multi_cable = 3 | ||
free_weights = 4 | ||
miscellaneous = 5 | ||
plate_loaded = 6 | ||
cardio = 0 | ||
racks_and_benches = 1 | ||
selectorized = 2 | ||
multi_cable = 3 | ||
free_weights = 4 | ||
miscellaneous = 5 | ||
plate_loaded = 6 | ||
|
||
|
||
class AccessibilityType(enum.Enum): | ||
|
||
wheelchair = 0 | ||
|
||
class Equipment(Base): | ||
|
||
__tablename__ = "equipment" | ||
wheelchair = 0 | ||
|
||
id = Column(Integer, primary_key=True) | ||
name = Column(String, nullable=False) | ||
equipment_type = Column(Enum(EquipmentType), nullable=False) | ||
facility_id = Column(Integer, ForeignKey("facility.id"), nullable=False) | ||
quantity = Column(Integer, nullable=True) | ||
accessibility = Column(Enum(AccessibilityType), nullable=True) | ||
|
||
def __init__(self, **kwargs): | ||
self.id = kwargs.get("id") | ||
self.name = kwargs.get("name") | ||
self.equipment_type = kwargs.get("equipment_type") | ||
self.facility_id = kwargs.get("facility_id") | ||
self.quantity = kwargs.get("quantity") | ||
self.accessibility = kwargs.get("accessibility") | ||
|
||
class Equipment(Base): | ||
|
||
__tablename__ = "equipment" | ||
|
||
id = Column(Integer, primary_key=True) | ||
name = Column(String, nullable=False) | ||
equipment_type = Column(Enum(EquipmentType), nullable=False) | ||
facility_id = Column(Integer, ForeignKey("facility.id"), nullable=False) | ||
quantity = Column(Integer, nullable=True) | ||
accessibility = Column(Enum(AccessibilityType), nullable=True) | ||
|
||
def __init__(self, **kwargs): | ||
self.id = kwargs.get("id") | ||
self.name = kwargs.get("name") | ||
self.equipment_type = kwargs.get("equipment_type") | ||
self.facility_id = kwargs.get("facility_id") | ||
self.quantity = kwargs.get("quantity") | ||
self.accessibility = kwargs.get("accessibility") |
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
Oops, something went wrong.