I've seen some nifty code on django-ratings documentation and like to create something similar. After googling around for now 2 weeks I got no idea on how to do this.
Maybe you could help me what to search for or where to get some docs?
Code from django-ratings docs:
...
response = AddRatingView()(request, **params)
if response.status_code == 200:
if response.content == 'Vote recorded.':
request.user.add_xp(settings.XP_BONUSES['submit-rating'])
return {'message': response.content, 'score': params['score']}
return {'error': 9, 'message': response.content}
...
My Problem:
request.user.add_xp(settings.XP_BONUSES['submit-rating'])
So i'd like to do something like this:
request.user.my_shiny_function(foobar)
Thanks in advance, Thomas