Change to allow for setting of tiebreaker rules through API #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After finally updating my fork of pychallonge to the latest most-official version, I think this change should be implemented in the official version. In
challonge/api.py
, I believe that line 157 should read:params.append(("%s[%s][]" % (prefix, k), val))
When I originally wrote this section of code in June of 2015 (see this commit), the goal of it was to allow for tiebreaker rules (and the order of tiebreaker rules) for round-robin tournaments to be set via the API. To my knowledge, the attribute
"tie_breaks"
is the only attribute in the API where the value is a list. I have tested out my version of the code, and it does allow for the setting of tiebreaker rules. I have not tested out ZEDGR's code specifically, but I did attempt a more direct method of updating the API using ZEDGR's version of line 157 and I got an error. I would suggest attempting to run the following lines of code and seeing what happens:import challonge
t = challonge.tournaments.create("Test RR", "hut5wr9w", tournament_type="round robin", ranked_by="match wins", tie_breaks=["match wins vs tied","points difference","points scored"])
My current commit also contains a
bulk_add
unit test, which ZEDGR's doesn't, but that's less important.