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

Add rival field to BearSerializer #6

Open
Bekabyx opened this issue Oct 8, 2022 · 0 comments
Open

Add rival field to BearSerializer #6

Bekabyx opened this issue Oct 8, 2022 · 0 comments

Comments

@Bekabyx
Copy link
Owner

Bekabyx commented Oct 8, 2022

A rival is a bear which has had multiple matchups with a given bear.

The criteria for this are:

  • BearSerializer should have a field named rival
  • rival will either be an object or null
  • When a given bear has faced any other single bear on multiple occasions, rival will contain the data of the rival bear
    • Where a bear has multiple rivals, the opponent with which a bear has had the most matchups will be returned as that bear's rival
  • When a given bear has only ever had unique pairings (i.e. has no rival), the rival field on BearSerializer will be set to null
"rival": null
"rival": {
    "url": "",  # String, URL to rival /bears/bear_uuid
    "bear_uuid": "",  # String, Rival bear's bear_uuid
    "matchups": 0,  # Integer, Number of times the given bear has been in a bracket with this bear
    "wins": 0 # Integer, Number of times the given bear has won a bracket against this bear
}
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