Why don't you add a BooleanField in your Book model ?
BILLION Sébastien
the Answer to the ultimate question of life, the universe and everything is42
http://www.sebastienbillion.com/
the Answer to the ultimate question of life, the universe and everything is
http://www.sebastienbillion.com/
Le 03/10/2011 15:00, gregory semah a écrit :
Hi everyone, I'm trying to create queryset of objects by adding for example a True/ False string for each objects Example: Normally a queryset of book in views could be books = Book.objects.all() I want to add in the books queryset, and for each book object a True/ False information in order to construct a new querySet like this [<Book: book1>, param=True],[<Book: book1>, param=False]...... Maybe I could need to label the string(with param keyword like the example above) in order to use it in templates as {% for book in books %} {% if param =True %} DO THIS {% else %} DO THAT {% endif %} {% endfor %} Do you know an easy way to do such thing? Really thanks in advance Grégory Sémah
No comments:
Post a Comment