russ- / pychallonge

Python bindings for the CHALLONGE! API
http://challonge.com/api
BSD 2-Clause "Simplified" License
49 stars 19 forks source link

Participant Creation #6

Closed piti166 closed 8 years ago

piti166 commented 8 years ago

The participant creation seems broken, I can use everything else in the api except the challonge.participants.create() method. I call it with the correct url and a simple name but get the following error:

"ChallongeException: Participant parameters are required"

Removing or adding parameters results in the error:

"TypeError: create() takes exactly 2 arguments (1 given)"

ZEDGR commented 8 years ago

You have to do it like this:

mytour = challonge.tournaments.show("mytournament")
part1 = challonge.participants.create(mytour['id'], "participant_name")
piti166 commented 8 years ago

I still get the Error, my concrete code is:

tournament = challonge.tournaments.create("name" + str(nr), url, "double elimination")
for name in participants:
    print(url, name)
    challonge.participants.create(tournament["id"],name)

participants is a list with given names in String form.

ZEDGR commented 8 years ago

Which python version are you using ?

piti166 commented 8 years ago

Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32

ZEDGR commented 8 years ago

I have just tested for Windows also your code snippet and no error appeared everything worked fine.

I suggest upgrading your python installation to Python 2.7.11 which is the latest version of 2.7 branch and try again.

I installed pychallonge from pip and my Python version is: 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)]

piti166 commented 8 years ago

I updatet Python an reinstalled challonge through pip and now it works, Thanks :)