コード例 #1
0
from project.common import gym_dataclass

Subscription = gym_dataclass(
    {
        'date': str,
        'customer_id': int,
        'trainer_id': int,
        'exercise_id': int,
    }, 'Subscription <{self.id}> on {self.date}')
コード例 #2
0
from project.common import gym_dataclass

Equipment = gym_dataclass({
    'name': str,
}, 'Equipment <{self.id}> {self.name}')
コード例 #3
0
ファイル: trainer.py プロジェクト: nkolew/Softuni-Python
from project.common import gym_dataclass

Trainer = gym_dataclass({
    'name': str,
}, 'Trainer <{self.id}> {self.name}')
コード例 #4
0
ファイル: customer.py プロジェクト: nkolew/Softuni-Python
from project.common import gym_dataclass

Customer = gym_dataclass({
    'name': str,
    'address': str,
    'email': str
}, 'Customer <{self.id}> {self.name}; Address: {self.address}; Email: {self.email}'
                         )
コード例 #5
0
from project.common import gym_dataclass


@classmethod
def from_hours(cls, trainer_id: int, equipment_id: int, hours: int):
    return cls(trainer_id, equipment_id, hours * 60)


ExercisePlan = gym_dataclass(
    {
        'trainer_id': int,
        'equipment_id': int,
        'duration': int,
    }, 'Plan <{self.id}> with duration {self.duration} minutes')

ExercisePlan.from_hours = from_hours