Browse Source

Explain why we can't move Abstract[Shipping|Billing]Address

Technically, they belong into the order app, and AbstractPartnerAddress
belongs into the partner app. I think they're in there because
AbstractUserAddress depends on AbstractShippingAddress. And maybe also
because trying to move them creates a rabbit hole of circular import
issues, which is why I gave up.
master
Maik Hoepfel 11 years ago
parent
commit
b2fa4fa75a
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      oscar/apps/address/abstract_models.py

+ 9
- 1
oscar/apps/address/abstract_models.py View File

@@ -439,7 +439,16 @@ class AbstractShippingAddress(AbstractAddress):
439 439
 
440 440
     A shipping address should not be edited once the order has been placed -
441 441
     it should be read-only after that.
442
+
443
+    NOTE:
444
+    ShippingAddress is a model of the order app. But moving it there is tricky
445
+    due to circular import issues that are amplified by get_model/get_class
446
+    calls pre-Django 1.7 to register receivers. So...
447
+    TODO: Once Django 1.6 support is dropped, move AbstractBillingAddress and
448
+    AbstractShippingAddress to the order app, and move
449
+    PartnerAddress to the partner app.
442 450
     """
451
+
443 452
     phone_number = PhoneNumberField(
444 453
         _("Phone number"), blank=True,
445 454
         help_text=_("In case we need to call you about your order"))
@@ -544,7 +553,6 @@ class AbstractUserAddress(AbstractShippingAddress):
544 553
 
545 554
 
546 555
 class AbstractBillingAddress(AbstractAddress):
547
-
548 556
     class Meta:
549 557
         abstract = True
550 558
         # BillingAddress is registered in order/models.py

Loading…
Cancel
Save