Ticket #2707: query.py.patch

File query.py.patch, 710 bytes (added by sdm@…, 9 years ago)

New version of Hit class

  • django/contrib/search/query.py

     
    2929
    3030    def get_pk(self):
    3131        raise NotImplementedError
     32   
     33    def get_object(self):
     34        return self.model.objects.get(pk=self.get_pk())
    3235
    3336    def __repr__(self):
    34         return "<%s: %s %s, Score: %s>" % (self.__class__.__name__,
     37        return "<%s: Model:%s pk:%s, Score:%s>" % (self.__class__.__name__,
    3538                                           self.model._meta,
    3639                                           self.get_pk(), self.score)
     40 No newline at end of file
Back to Top