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

Unable to figure out how to add games #1

Open
jareds opened this issue Jan 22, 2015 · 1 comment
Open

Unable to figure out how to add games #1

jareds opened this issue Jan 22, 2015 · 1 comment

Comments

@jareds
Copy link

jareds commented Jan 22, 2015

I am unable to figure out how to add games to the database. When running
python manage.py shell<build.py
I get
NameError: name 'add_game' is not defined

In [6]: ------------------------------------------------------------------------

NameError Traceback (most recent call last)
/usr/local/lib/python2.7/dist-packages/django/core/management/commands/shell.pyc
in ()
----> 1 add_game(12020598)
NameError: name 'add_game' is not defined

Updating the readme to explain how to add games would be helpful.

@bkenny266
Copy link
Owner

Hey, I'm not sure what shell<build.py does. I'm kind of a novice at django and this is my first real programming project in general so you'll have to forgive me. I didn't really actually expect anyone to try to use this.

You can load a game to the db by running manage.py shell, then import datamanger.models and run the load_headers() class method of GameProcessor. This will grab a page of game headers from nhl.com and load it to the database. After that you should be able to load the complete shift data for each of those games using django's admin.

Alternately, you can skip the header stuff and load the games by game number by importing datamanager.utility and running add_game(12020598)

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

2 participants