return render_to_response('path/to/template.html', {'items': items})
Where items is a list of item objects. You can simply add more key-value
pairs to the dict to add your counts:
items_25_to_50_count = Item.objects.filter(price__gte=25,
price__lte=50).count()
return render_to_response('path/to/template.html',
{'items': items, 'items_25_to_50_count': items_25_to_50_count})
Hopefully this helps with your question.
Brett
>--
>You received this message because you are subscribed to the Google Groups
>"Django users" group.
>To post to this group, send email to django...@googlegroups.com.
>To unsubscribe from this group, send email to
>django-users...@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
I think jQuery supports this sort of thing, (as I'm sure other
Javascript libs do). Then again, learning Javascript + jQuery together
seems at least as hard as learning Python + Django.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJPI8VQAAoJEH+72ZVdir1G7P4P/2RjG5MI1NivppUL2gZevkRI
YblHMSwf/RMWX4YjxCbhJNnzAsprNDIwcqKCwfCQo2RCElgz4/r+FTgbA+NN/R81
D6NZAbKqOHWl3jvNKTpytCbMthxRMsE8Frj5gyr1iD4xxEFrYePByOd3Qwml1dCb
3b5aSVQ+4BX84b+vLy8juo/bZb8fQM4oqlu4lUhjqJRGNNSPruXQ9/iom0ugIkyO
QnrAwFnsoJW1+3yGSI7X/p8InWTCznGyFQulOq9cYzmaakXnSjWdLEbg3LCwXqoU
uKJmofVYGVcu5gMXfLhIulJPpCkPgTL+f+Zp91ii49sSgiv2PheqC8aAKv3vhSea
TPF3RzQfkhaUuAA/E/nlagvbOIBfbeSTTy4SG/X5oRS4lD3Lp57BX6g7uiOEeVMV
tgjTRgMq2GrtVxxhL3NSbYhChSWHooNfFN94i8CjZmp3KyjxbVDZuFaeo2PAYlo6
knrkjYWP49mcnM98MetBFe1YupAjJ8lsfMPChfa6Ot/ixGbB+DFk7gnRsnz4D8FU
w7ZBorUiGOclwtwlVpKVOtfT7kb48kzQHf4fidqL3RHZJNusShT94X4fs5VcLOoO
dpDJLwxluBMPpGb7xBMfkhDvdClVDZNnhKYQr0XndydYEDa01ne+4iwHZtsPieaH
R7EFAOahr78c0f8Usj7Y
=JYjK
-----END PGP SIGNATURE-----