I would like to add custom sort by favorites (number of times a question is added to favorites). How can that be done?

asked 26 Mar '11, 15:25

Stanislav's gravatar image

Stanislav
62582834
accept rate: 0%


If you would like to create your own sort processors you'll probably have to take a look at the forum.views.readers.QuestionListPaginatorContext and pagination.SimpleSort classes.

A good example that can be used while you're creating the Custom Sort class is forum.views.readers.HottestQuestionsSort and specifically the apply method.

After you create the custom Sort class you'll have to extend the QuestionListPaginatorContext.__init__ method adding the new sort method to the sort_methods tuple.

That's it in general. Good luck!

link

answered 28 Mar '11, 04:46

Jordan's gravatar image

Jordan ♦♦
3.1k618
accept rate: 38%

Thank you.

(28 Mar '11, 05:35) Stanislav
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×12

Asked: 26 Mar '11, 15:25

Seen: 286 times

Last updated: 28 Mar '11, 05:35

powered by OSQA