First time here? Check out the FAQ!
1

How can I filter questions by title/name?
 

I'm trying to find an exact question in the django console but I can't guess how.

I've done the following:

from askbot.models import Post
questions = Post.objects.get_questions()

Now, how to filter them by title?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
mornaner's avatar
109
mornaner
asked 12 years ago

Comments

see more comments

1 Answer

1

You can try this:

Post.objects.get_questions().filter(thread__title__icontains='foo')

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Fitoria's avatar
1.1k
Fitoria
answered 12 years ago
link

Comments

see more comments