Skip to content
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

ActiveFixture - Addition of Foreign Keys #2

Open
varneyo opened this issue Dec 17, 2021 · 0 comments
Open

ActiveFixture - Addition of Foreign Keys #2

varneyo opened this issue Dec 17, 2021 · 0 comments

Comments

@varneyo
Copy link
Collaborator

varneyo commented Dec 17, 2021

ActiveFixture fixture resource could do with sport_id: int, region_id: int, competition_id: int adding. New resource would look like:

class ActiveFixture(BaseResource):
fixture_id: int
display_name: str
start_date: datetime = Field(alias="startdate")
time: str
each_way_active: str
# waiting on sport_id: int ?
# waiting on region_id: int ?
# waiting on competition_id: int ?

@validator('start_date', pre=True)
def date_parser(cls, v):
    if isinstance(v, str):
        return datetime.fromisoformat(v)
    elif isinstance(v, datetime):
        return v
    else:
        raise TypeError(f"Expected value of type str or datetime")

def __repr__(self):
    return f"Fixture: {self.display_name}({self.fixture_id}) {self.start_date}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant