-
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 #169 from cuappdev/migrate-dev-server
Migrate dev server
- Loading branch information
Showing
10 changed files
with
480 additions
and
112 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,44 @@ | ||
import enum | ||
from sqlalchemy import Column, String, Enum, Integer, ForeignKey | ||
from sqlalchemy import Column, String, Enum, Integer, ForeignKey, ARRAY | ||
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 | ||
class MuscleGroup(enum.Enum): | ||
ABDOMINALS = 1 # Core/Ab exercises | ||
CHEST = 2 # Chest exercises | ||
BACK = 3 # Back exercises | ||
SHOULDERS = 4 # Shoulder exercises | ||
BICEPS = 5 # Bicep exercises | ||
TRICEPS = 6 # Tricep exercises | ||
HAMSTRINGS = 7 # Hamstring exercises | ||
QUADS = 8 # Quad exercises | ||
GLUTES = 9 # Glute exercises | ||
CALVES = 10 # Calf exercises | ||
MISCELLANEOUS = 11 # General equipment, accessories, and multi-purpose items | ||
CARDIO = 12 # Cardiovascular equipment | ||
|
||
|
||
class AccessibilityType(enum.Enum): | ||
|
||
wheelchair = 0 | ||
|
||
|
||
class Equipment(Base): | ||
|
||
__tablename__ = "equipment" | ||
|
||
id = Column(Integer, primary_key=True) | ||
name = Column(String, nullable=False) | ||
equipment_type = Column(Enum(EquipmentType), nullable=False) | ||
muscle_groups = Column(ARRAY(Enum(MuscleGroup)), nullable=False) | ||
clean_name = Column(String, 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") | ||
def __init__(self, **kwargs): | ||
self.id = kwargs.get("id") | ||
self.name = kwargs.get("name") | ||
self.muscle_groups = kwargs.get("muscle_groups") | ||
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
Oops, something went wrong.