Did I find the right examples for you? yes no

All Samples(21)  |  Call(21)  |  Derive(0)  |  Import(0)

src/d/j/django-lfs-0.7.7/lfs/manage/views/marketing/topseller.py   django-lfs(Download)
 
        temp_id = temp_id.split("-")[1]
        Topseller.objects.create(product_id=temp_id)
 
    _update_positions()

src/d/j/django-lfs-HEAD/lfs/manage/views/marketing/topseller.py   django-lfs(Download)
 
        temp_id = temp_id.split("-")[1]
        Topseller.objects.create(product_id=temp_id)
 
    _update_positions()

src/l/f/lfs-HEAD/manage/views/marketing/topseller.py   lfs(Download)
 
        temp_id = temp_id.split("-")[1]
        Topseller.objects.create(product_id=temp_id)
 
    inline = manage_topseller_inline(request, as_string=True)    

src/d/j/django-lfs-0.7.7/lfs/marketing/tests.py   django-lfs(Download)
    def setUp(self):
        """
        """
        self.p1 = Product.objects.create(name="Product 1", slug="product-1", active=True)
        self.t1 = Topseller.objects.create(product=self.p1)
        # Explicit topseller
        self.p5 = Product.objects.create(name="Product 5", slug="product-5", active=True)
        t5 = Topseller.objects.create(product=self.p5, position=1)
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p5)
        self.assertEqual(ts[1], self.p4)
 
        self.p6 = Product.objects.create(name="Product 6", slug="product-6", active=True)
        t6 = Topseller.objects.create(product=self.p6, position=2)
 
        # Explicit topseller P4, which is already a topseller
        t = Topseller.objects.create(product=self.p4, position=1)
 
        # P4 should only displayed once
        # Explicit topseller for c1
        self.p5 = Product.objects.create(name="Product 5", slug="product-5", active=True)
        t5 = Topseller.objects.create(product=self.p5, position=1)
 
        self.c11.products = (self.p1, self.p2, self.p5)

src/d/j/django-lfs-HEAD/lfs/marketing/tests.py   django-lfs(Download)
    def setUp(self):
        """
        """
        self.p1 = Product.objects.create(name="Product 1", slug="product-1", active=True)
        self.t1 = Topseller.objects.create(product=self.p1)
        # Explicit topseller
        self.p5 = Product.objects.create(name="Product 5", slug="product-5", active=True)
        t5 = Topseller.objects.create(product=self.p5, position=1)
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p5)
        self.assertEqual(ts[1], self.p4)
 
        self.p6 = Product.objects.create(name="Product 6", slug="product-6", active=True)
        t6 = Topseller.objects.create(product=self.p6, position=2)
 
        # Explicit topseller P4, which is already a topseller
        t = Topseller.objects.create(product=self.p4, position=1)
 
        # P4 should only displayed once
        # Explicit topseller for c1
        self.p5 = Product.objects.create(name="Product 5", slug="product-5", active=True)
        t5 = Topseller.objects.create(product=self.p5, position=1)
 
        self.c11.products = (self.p1, self.p2, self.p5)

src/l/f/lfs-HEAD/marketing/tests.py   lfs(Download)
    def setUp(self):
        """
        """
        self.p1 = Product.objects.create(name="Product 1", slug="product-1", active=True)        
        self.t1 = Topseller.objects.create(product = self.p1)
        # Explicit topseller
        self.p5 = Product.objects.create(name="Product 5", slug="product-5", active=True)
        t5 = Topseller.objects.create(product=self.p5, position=1)
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p5)
        self.assertEqual(ts[1], self.p4)
 
        self.p6 = Product.objects.create(name="Product 6", slug="product-6", active=True)
        t6 = Topseller.objects.create(product=self.p6, position=2)
 
        # Explicit topseller P4, which is already a topseller
        t = Topseller.objects.create(product=self.p4, position=1)
 
        # P4 should only displayed once
        # Explicit topseller for c1
        self.p5 = Product.objects.create(name="Product 5", slug="product-5", active=True)
        t5 = Topseller.objects.create(product=self.p5, position=1)
 
        self.c11.products = (self.p1, self.p2, self.p5)