I know that I can do that, of course,
but this is not my question, i just want to know if it's possible and
how, I mean overwriting queryset with others values not dependant of
models instances, and be able to retrieve them from templates as part
of objects
Thanks
On 3 oct, 15:40, BILLION Sébastien <sebastien.bill...@gmail.com>
wrote:
> Hi,
>
> 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
> is 42
>
> http://www.sebastienbillion.com/<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
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment