Each product can have multiple images.
images are divided by type. it facilitates the withdrawal of the
desired image in the right place.
On 27 дек, 01:35, Mikhail Korobov wrote:
> production = Production.objects.all()
> for product in production:
> try:
>
production = Production.objects.all()
for product in production:
try:
product.image = product.image_set.get (somefield = somevalue)
except Image.DoesNotExist:
pass
{% for product in production %}
{{ product.title }}
{% endfor %}
or even better implement the
I'm sorry for my english, but on other groups nobody does not answers.
In view defined variables:
production = Production.objects.all ()
images = {}
for product in production:
try:
image = product.image_set.get (somefield = somevalue)
images [product.id] = image
except:
3 matches
Mail list logo