sachin
sachin

Reputation: 11

django model returning multiple values

i have to convert some of my code from django to PHP

here is the sample code:

def loadProduct(id=0)
  if id==0:
      product=BaseProduct.products.all()[0];
  else:
       product = BaseProduct.objects.get(id=id);
  color = product.color
  images = color.images.all();
  return {'product':product, 'color':{'color':color, 'images':images}}

now i have some basic knowledge of django..
but not able to understand this return type in this...

can any one help me on this...

Upvotes: 1

Views: 1193

Answers (1)

Burhan Khalid
Burhan Khalid

Reputation: 174624

The method is returning a dictionary, which is roughly equivalent to an associative array in PHP.

Upvotes: 1

Related Questions