Skip to content

Commit

Permalink
remove all occurences of inheritance from object
Browse files Browse the repository at this point in the history
  • Loading branch information
jrief committed May 15, 2020
1 parent c23b595 commit 284c92c
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion shop/admin/delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
2 changes: 1 addition & 1 deletion shop/admin/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion shop/admin/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion shop/cascade/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions shop/cascade/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion shop/conf.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion shop/deferred.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/forms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion shop/models/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion shop/models/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions shop/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/modifiers/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class BaseCartModifier(object):
class BaseCartModifier:
"""
Cart Modifiers are the cart's counterpart to backends.
Expand Down
2 changes: 1 addition & 1 deletion shop/modifiers/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from shop.conf import app_settings


class CartModifiersPool(object):
class CartModifiersPool:

USE_CACHE = True

Expand Down
2 changes: 1 addition & 1 deletion shop/payment/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from shop.models.order import OrderModel


class PaymentProvider(object):
class PaymentProvider:
"""
Base class for all Payment Service Providers.
"""
Expand Down
4 changes: 2 additions & 2 deletions shop/payment/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion shop/rest/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion shop/shipping/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion shop/views/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand Down

0 comments on commit 284c92c

Please sign in to comment.