def view( self, request ): product_categories = ProductCategory.objects.all().order_by( 'id' ) producers = Producer.objects.all().order_by( 'id' ) countries = Country.objects.all().order_by( 'id' ) products_id_name = Product.objects.values( 'id', 'name' ).order_by( 'id' ) return TemplateView.view( self, request, { 'products_id_name': products_id_name, 'product_categories': product_categories, 'producers': producers, 'countries': countries } )
def view( self, request, dictionary = {} ): products = Product.objects.all() for product in products: product.image = DefaultImageManager.DEFAULT_IMAGE product.save() return TemplateView.view( self, request, {} )