diff --git a/shop/admin/delivery.py b/shop/admin/delivery.py index f000061a0..18aeb1eec 100644 --- a/shop/admin/delivery.py +++ b/shop/admin/delivery.py @@ -185,7 +185,7 @@ def fulfilled(self, obj): fulfilled.short_description = _("Fulfilled at") -class DeliveryOrderAdminMixin(object): +class DeliveryOrderAdminMixin: """ Add this mixin to the class defining the OrderAdmin """ diff --git a/shop/admin/order.py b/shop/admin/order.py index ef20d0014..b6cd8bab6 100644 --- a/shop/admin/order.py +++ b/shop/admin/order.py @@ -198,7 +198,7 @@ def change_view(self, request, object_id, form_url='', extra_context=None): return response -class PrintInvoiceAdminMixin(object): +class PrintInvoiceAdminMixin: """ A customized OrderAdmin class shall inherit from this mixin class, to add methods for printing the the invoice. diff --git a/shop/admin/product.py b/shop/admin/product.py index 6b2dc555e..2280fbc30 100644 --- a/shop/admin/product.py +++ b/shop/admin/product.py @@ -42,7 +42,7 @@ def label_from_instance(self, obj): return str(obj) -class CMSPageAsCategoryMixin(object): +class CMSPageAsCategoryMixin: """ Add this mixin class to the ModelAdmin class for products wishing to be assigned to djangoCMS pages when used as categories. diff --git a/shop/cascade/checkout.py b/shop/cascade/checkout.py index 14139ba50..2434ec45b 100644 --- a/shop/cascade/checkout.py +++ b/shop/cascade/checkout.py @@ -310,7 +310,7 @@ def get_form_data(self, context, instance, placeholder): DialogFormPluginBase.register_plugin(ExtraAnnotationFormPlugin) -class AcceptConditionMixin(object): +class AcceptConditionMixin: render_template = 'shop/checkout/accept-condition.html' def render(self, context, instance, placeholder): diff --git a/shop/cascade/extensions.py b/shop/cascade/extensions.py index bf0d13df6..4545295b6 100644 --- a/shop/cascade/extensions.py +++ b/shop/cascade/extensions.py @@ -4,7 +4,7 @@ from shop.cascade.plugin_base import ShopPluginBase -class ShopExtendableMixin(object): +class ShopExtendableMixin: """ Add this mixin class to the list of ``model_mixins``, in the plugin class wishing to use extensions. """ @@ -25,7 +25,7 @@ def right_extension(self): return result[0] -class LeftRightExtensionMixin(object): +class LeftRightExtensionMixin: """ Plugin classes wishing to use extensions shall inherit from this class. """ diff --git a/shop/conf.py b/shop/conf.py index cab2ce4c8..7ab8d8725 100644 --- a/shop/conf.py +++ b/shop/conf.py @@ -1,4 +1,4 @@ -class DefaultSettings(object): +class DefaultSettings: def _setting(self, name, default=None): from django.conf import settings return getattr(settings, name, default) diff --git a/shop/deferred.py b/shop/deferred.py index effb34228..6d9f36394 100644 --- a/shop/deferred.py +++ b/shop/deferred.py @@ -9,7 +9,7 @@ from shop.conf import app_settings -class DeferredRelatedField(object): +class DeferredRelatedField: def __init__(self, to, **kwargs): try: self.abstract_model = to._meta.object_name diff --git a/shop/forms/base.py b/shop/forms/base.py index 87948d296..9d1712d85 100644 --- a/shop/forms/base.py +++ b/shop/forms/base.py @@ -110,7 +110,7 @@ def field_css_classes(self): return css_classes -class UniqueEmailValidationMixin(object): +class UniqueEmailValidationMixin: """ A mixin added to forms which have to validate for the uniqueness of email addresses. """ diff --git a/shop/models/customer.py b/shop/models/customer.py index e2b203efb..5261540c1 100644 --- a/shop/models/customer.py +++ b/shop/models/customer.py @@ -369,7 +369,7 @@ def delete(self, *args, **kwargs): CustomerModel = deferred.MaterializedModel(BaseCustomer) -class VisitingCustomer(object): +class VisitingCustomer: """ This dummy object is used for customers which just visit the site. Whenever a VisitingCustomer adds something to the cart, this object is replaced against a real Customer object. diff --git a/shop/models/inventory.py b/shop/models/inventory.py index a168d0304..ae063b8b0 100644 --- a/shop/models/inventory.py +++ b/shop/models/inventory.py @@ -8,7 +8,7 @@ from shop.exceptions import ProductNotAvailable -class AvailableProductMixin(object): +class AvailableProductMixin: """ Add this mixin class to the product models declaration, wanting to keep track on the current amount of products in stock. In comparison to diff --git a/shop/models/product.py b/shop/models/product.py index e35b5246b..70d09c8dd 100644 --- a/shop/models/product.py +++ b/shop/models/product.py @@ -25,7 +25,7 @@ from shop.exceptions import ProductNotAvailable -class Availability(object): +class Availability: """ Contains the currently available quantity for a given product and period. """ @@ -59,7 +59,7 @@ def __init__(self, **kwargs): self.inventory = bool(kwargs.get('inventory', None)) -class AvailableProductMixin(object): +class AvailableProductMixin: """ Add this mixin class to the product models declaration, wanting to keep track on the current amount of products in stock. In comparison to @@ -112,7 +112,7 @@ def check(cls, **kwargs): return errors -class BaseReserveProductMixin(object): +class BaseReserveProductMixin: def get_availability(self, request, **kwargs): """ Returns the current available quantity for this product. @@ -375,7 +375,7 @@ def invalidate_cache(self): ProductModel = deferred.MaterializedModel(BaseProduct) -class CMSPageReferenceMixin(object): +class CMSPageReferenceMixin: """ Products which refer to CMS pages in order to emulate categories, normally need a method for being accessed directly through a canonical URL. Add this mixin class for adding a diff --git a/shop/modifiers/base.py b/shop/modifiers/base.py index bd5b5a4c6..adf50ead3 100644 --- a/shop/modifiers/base.py +++ b/shop/modifiers/base.py @@ -1,4 +1,4 @@ -class BaseCartModifier(object): +class BaseCartModifier: """ Cart Modifiers are the cart's counterpart to backends. diff --git a/shop/modifiers/pool.py b/shop/modifiers/pool.py index b090fbfaf..3a78a927b 100644 --- a/shop/modifiers/pool.py +++ b/shop/modifiers/pool.py @@ -2,7 +2,7 @@ from shop.conf import app_settings -class CartModifiersPool(object): +class CartModifiersPool: USE_CACHE = True diff --git a/shop/payment/providers.py b/shop/payment/providers.py index dcc5917a3..663472028 100644 --- a/shop/payment/providers.py +++ b/shop/payment/providers.py @@ -2,7 +2,7 @@ from shop.models.order import OrderModel -class PaymentProvider(object): +class PaymentProvider: """ Base class for all Payment Service Providers. """ diff --git a/shop/payment/workflows.py b/shop/payment/workflows.py index bd7e56611..b5914a7a5 100644 --- a/shop/payment/workflows.py +++ b/shop/payment/workflows.py @@ -5,7 +5,7 @@ from shop.models.order import BaseOrder -class ManualPaymentWorkflowMixin(object): +class ManualPaymentWorkflowMixin: """ Add this class to `settings.SHOP_ORDER_WORKFLOWS` to mix it into your `OrderModel`. It adds all the methods required for state transitions, when used with the @@ -69,7 +69,7 @@ def payment_refunded(self): return 'refund_payment' if self.amount_paid else 'order_canceled' -class CancelOrderWorkflowMixin(object): +class CancelOrderWorkflowMixin: """ Add this class to `settings.SHOP_ORDER_WORKFLOWS` to mix it into your `OrderModel`. It adds all the methods required for state transitions, to cancel an order. diff --git a/shop/rest/renderers.py b/shop/rest/renderers.py index cf90c84b9..5d7104bce 100644 --- a/shop/rest/renderers.py +++ b/shop/rest/renderers.py @@ -5,7 +5,7 @@ from shop.serializers.cart import CartSerializer -class TemplateContextMixin(object): +class TemplateContextMixin: """ Alternative implementation which does not pollute the template context with the serialized data on the root scope. diff --git a/shop/shipping/workflows.py b/shop/shipping/workflows.py index 21ee7b94b..2873b794d 100644 --- a/shop/shipping/workflows.py +++ b/shop/shipping/workflows.py @@ -6,7 +6,7 @@ from shop.models.delivery import DeliveryModel, DeliveryItemModel -class SimpleShippingWorkflowMixin(object): +class SimpleShippingWorkflowMixin: """ Workflow for simply marking the state of an Order while picking, packing and shipping items. It does not create a Delivery object. diff --git a/shop/views/catalog.py b/shop/views/catalog.py index 2ff59b536..dae4fab96 100644 --- a/shop/views/catalog.py +++ b/shop/views/catalog.py @@ -342,7 +342,7 @@ def get_queryset(self): return ProductModel.objects.all() -class AddFilterContextMixin(object): +class AddFilterContextMixin: """ A mixin to enrich the render context by ``filter`` containing information on how to render the filter set, supplied by attribute ``filter_class``.