Exemplo n.º 1
0
 def options(self):
     options = []
     complexproduct_options = [
         'sizes',
         'colours']
     for key in complexproduct_options:
         try:
             cp_opt = ComplexProductOption.objects.get(pk=self.cleaned_data[key])
             option = BasketItemOption(content_object=cp_opt)
             option.description = '%s' % cp_opt.value
             option.save()
             options.append(option)
         except Exception, e:
             pass