Hi, I've just made a patch for using get_top function passing a custom manager
like this:
### models.py ###
from django.db import models
class MyManager(models.Manager):
def get_query_set(self):
return super(MyManager, self).get_query_set().filter(published=True)
class MyModel(models.Model):
published = models.BooleanField()
objects = models.Manager()
published_objects = MyManager()
### views.py ####
from voting.models import Vote
from models import *
def view_best(request):
my = Votes.objects.get_top(MyModel.published_objects)
return my
I hope this will be useful ;)
Original issue reported on code.google.com by patrick....@gmail.com on 30 Dec 2009 at 10:48
Original issue reported on code.google.com by
patrick....@gmail.com
on 30 Dec 2009 at 10:48