I am using django-voting package and have been trying to get it's manager get_top() to work. I've stumbled upon one problem - it produces generator (from which actually I need to extract data to select items from database on) which seems to be a problem for me.
After spending two days of googling and reading forums, the closest think I came to was this: What is "generator object" in django?
It says that any generator can be converted to list by:
mylist=list(myGenerator)
Althought if I do convert generator to list I get the following error:
'NoneType' object has no attribute '_meta'
Here is my view and model code:
def main(request):
temporary = TopIssue.objects.get_top(Model=Issue, limit=10)
temp_list = list(temporary)
return render_to_response('main/index.html', temp_list)
from voting.managers import VoteManager
class TopIssue:
objects = VoteManager()
Any ideas?