Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(3)  |  Derive(5)  |  Import(4)
Repository class responsible for returning ShippingMethod
objects for a given user, basket etc

src/d/j/django-oscar-paypal-HEAD/sandbox/apps/shipping/repository.py   django-oscar-paypal(Download)
from decimal import Decimal as D
 
from oscar.apps.shipping.methods import Free, FixedPrice
from oscar.apps.shipping.repository import Repository as CoreRepository
 
 
class Repository(CoreRepository):

src/d/j/django-oscar-accounts-HEAD/sandbox/apps/shipping/repository.py   django-oscar-accounts(Download)
from decimal import Decimal as D
from oscar.apps.shipping.methods import FixedPrice, NoShippingRequired
from oscar.apps.shipping.repository import Repository as CoreRepository
 
# Dummy shipping methods
class Repository(CoreRepository):
    def get_shipping_methods(self, user, basket, shipping_addr=None, **kwargs):
        return self.prime_methods(basket, METHODS)
 
    def find_by_code(self, code, basket):

src/d/j/django-oscar-HEAD/sites/demo/apps/shipping/repository.py   django-oscar(Download)
class Repository(repository.Repository):
    methods = (methods.Standard, methods.Express)
 

src/d/j/django-oscar-HEAD/tests/unit/shipping/repository_tests.py   django-oscar(Download)
    def setUp(self):
        self.repo = repository.Repository()
        self.basket = Basket()
 
    def test_returns_free_as_only_option(self):

src/d/j/django-oscar-HEAD/tests/integration/order/creator_tests.py   django-oscar(Download)
from oscar.apps.order.utils import OrderCreator
from oscar.apps.shipping.methods import Free, Base
from oscar.apps.shipping.repository import Repository
from oscar.core.loading import get_class
from oscar.test import factories
class StubRepository(Repository):
    """ Custom shipping methods """
    methods = (Fixed, Free)
 
 

src/d/j/django-oscar-HEAD/tests/integration/offer/shipping_percentage_benefit_tests.py   django-oscar(Download)
        utils.Applicator().apply_offers(self.basket, [self.offer])
 
        repo = repository.Repository()
        raw_method = ExcludingTax()
        method = repo.prime_method(self.basket, raw_method)
        utils.Applicator().apply_offers(self.basket, [self.offer])
 
        repo = repository.Repository()
        raw_method = IncludingTax()
        method = repo.prime_method(self.basket, raw_method)

src/d/j/django-oscar-HEAD/tests/integration/offer/shipping_benefit_tests.py   django-oscar(Download)
from oscar.apps.offer import models, utils
from oscar.apps.order.utils import OrderCreator
from oscar.apps.shipping.repository import Repository
from oscar.apps.shipping.methods import FixedPrice
from oscar.test.basket import add_product
class StubRepository(Repository):
    """
    Stubbed shipped repository which overrides the get_shipping_methods method
    in order to use a non-free default shipping method.  This allows the
    shipping discounts to be tested.