You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First things first: Thank you very much for your efforts in building this Python package. It saves me lots of hours for sure. Keep up the good work.
Nevertheless, I have a small issue when fetching data from the Stackoverflow site. I try to load a specific user object and would like to get reputation as well as up vote count, down vote count and view count. Fetching reputation works well, but when I try to access the other attributes, such as up_vote_count, I fail.
When running the code, I can fetch reputation successfully, but get this error for the other attribute:
Traceback (most recent call last):
File "./stacktrack.py", line 405, in <module>
user_data = so_get_user_obj_as_dict(so_user_obj)
File "./stacktrack.py", line 193, in so_get_user_obj_as_dict
user_dict['up_votes_received'] = so_user_obj.up_vote_count
AttributeError: 'User' object has no attribute 'up_vote_count'
I actually thought, that up_vote_count, down_vote_count and view_count are part of the response, because of this code in models.py (~ line 342):
class User(JSONModel):
"""Describes a user on a StackExchange site."""
transfer = ('display_name', 'profile_image', 'age', 'website_url',
'location', 'about_me', 'view_count', 'up_vote_count',
'down_vote_count', 'account_id', 'profile_image',
('creation_date', UNIXTimestamp),
('last_access_date', UNIXTimestamp),
('reputation', FormattedReputation),
...
What am I doing wrong here?
I use Python 3.4.3 with py-stackexchange 2.2.7 (installed via pip3).
Any help highly appreciated!
Thank you
André
The text was updated successfully, but these errors were encountered:
This is also described on StackApps: https://stackapps.com/a/7649/49901 (sorry, for cross-posting, but didn't know where you look for / answer issues with the wrapper. ;-)
First things first: Thank you very much for your efforts in building this Python package. It saves me lots of hours for sure. Keep up the good work.
Nevertheless, I have a small issue when fetching data from the Stackoverflow site. I try to load a specific user object and would like to get reputation as well as up vote count, down vote count and view count. Fetching reputation works well, but when I try to access the other attributes, such as up_vote_count, I fail.
Here is my code so far:
When running the code, I can fetch reputation successfully, but get this error for the other attribute:
I actually thought, that
up_vote_count
,down_vote_count
andview_count
are part of the response, because of this code in models.py (~ line 342):What am I doing wrong here?
I use Python 3.4.3 with py-stackexchange 2.2.7 (installed via pip3).
Any help highly appreciated!
Thank you
André
The text was updated successfully, but these errors were encountered: