Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3949926
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:33:04+00:00 2026-05-20T01:33:04+00:00

I am using django-voting package and have been trying to get it’s manager get_top()

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:33:05+00:00Added an answer on May 20, 2026 at 1:33 am

    Maybe this is just a typo in your example code, but your class TopIssue is not derived from a Django model class. That could also explain why you get the error message about the missing _meta attribute.

    Edit: I’m not familiar with django-voting, but from skimming the docs, the first argument to the manager’s get_top() function has to be a Django Model.

    You accomplish that by inheriting from a base class provided by Django. Django models are explained in the Django Model Documentation.

    Thus at the very least, your TopIssue class should be declared like this:

    from django.db import models
    
    class TopIssue(models.Model):
        # fields go here
        objects = VoteManager() # for integration with django-voting
    

    Your TopIssue class should be a database model, and the get_top() function is supposed to return the top voted instance of that model. Please post the rest of your code if you have further questions (it seems very strange to me if what you have posted is your complete TopIssue class — you are missing fields, etc.).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Django's built in models, how would one create a triple-join between three models.
I'm using Django to write a blog app, and I'm trying to implement a
Is it possible to have a variable number of fields using django forms? The
I'm trying to figure out how to implement my first RESTful interface using Django
I am using django-voting as a voting application for two of my models. Those
Using Django 1.1, I am trying to select the maximum value from a varchar
I'm considering using Django for a project I'm starting (fyi, a browser-based game) and
I am having problems using django-tagging . I try to follow the documentation but
I'm using Django and Python 2.6, and I want to grow my application using
I'm using django and when users go to www.website.com/ I want to point them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.