-
Notifications
You must be signed in to change notification settings - Fork 46
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
Feature request: "Equipment" that can be associated with workouts #259
Comments
I've started working on this in my |
Hi, I had the same feature in mind (I have 3 bikes) and planned to work on it with workouts improvements (v0.9.x, I am currently working on v0.8.x when I have some free time). This feature may have some impacts, is it possible to discuss the changes before (to avoid unnecessary work and plan it in a version)? Thanks in advance. |
Sure, it's a bit more involved of a feature so it's good to make sure what I'm working on will mesh with your vision. As for overall design, I've started working on a model of Currently, this model sits in Equipment model:EquipmentWorkout = db.Table(
'equipment_workout',
db.Column(
'equipment_id',
db.Integer,
db.ForeignKey('equipment.id'),
primary_key=True,
),
db.Column(
'workout_id',
db.Integer,
db.ForeignKey('workouts.id'),
primary_key=True,
),
)
class Equipment(BaseModel):
__tablename__ = 'equipment'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
user_id = db.Column(
db.Integer, db.ForeignKey('users.id'), index=True, nullable=False
)
label = db.Column(db.String(50), unique=False, nullable=False)
description = db.Column(db.String(200), default=None, nullable=True)
creation_date = db.Column(db.DateTime, default=datetime.datetime.utcnow)
is_active = db.Column(db.Boolean, default=True, nullable=False)
workouts = db.relationship(
'Workout', secondary=EquipmentWorkout, backref='equipment'
) I'm also trying to implement that in their sport preferences, a user can set a default piece of equipment to use for new activities if one is not provided at creation time. I've got most of the basic CRUD API functionality working for that model, and have been working more recently on integrating it with the workout and user preference endpoints. One area where I'm a little uncertain is the distinction between what should be under the I haven't started work on the front-end at all (wanted to nail down the API first). As an aside, I'm using this as a bit of a learning opportunity, since I'm casually familiar with a number of the tools in the stack (Flask, SQLAlchemy, Vue even less so), but I haven't done more than some toy examples with them, and working on a real codebase is how I learn best. That being said, I don't want to make a lot more work for you to review stuff, so even if my work doesn't get committed as-is, hopefully you could use it as a base. |
Hi! Sorry for my late reply and thanks for the details. The data model is close to what I had in mind.
If you have any questions, you can also reach me on matrix: #fittrackee:matrix.org. As I said above, I'm currently working on social features, that require a lot of changes and also impact workouts (that's why some features and major changes are pending, integrating new features delaying this part). |
released in v0.8.0 |
for information, I made a script to add equipments to existing workouts: https://codeberg.org/SamR1/workouts-equipments-updater |
Some proprietary tools have a concept of "gear" or "equipment" that gets saved alongside a workout:
The nice feature with this is it allows you to keep track of how many miles, minutes, etc. you have put on a piece of equipment (useful for runners that swap out shoes every X miles or something). A similar feature in FitTrackee could be nice to have.
Implementation wise, it could probably look a lot like how "sports" are currently implemented, with a new DB table for pieces of equipment (each associated with a user), and then at upload time allowing for selecting of one (or more) pieces of associated equipment.
The text was updated successfully, but these errors were encountered: