소스 검색

Renamed 'stock' app to 'partner'

master
David Winterbottom 14 년 전
부모
커밋
ee1c921c05

+ 1
- 1
examples/recreate_project_tables.sh 파일 보기

14
 fi
14
 fi
15
 echo "Recreating all tables in $PROJECT_FOLDER"
15
 echo "Recreating all tables in $PROJECT_FOLDER"
16
 echo "Dropping tables"
16
 echo "Dropping tables"
17
-$MANAGE_COMMAND sqlclear promotions analytics payment offer shipping order basket stock image address product | \
17
+$MANAGE_COMMAND sqlclear promotions analytics payment offer shipping order basket partner image address product | \
18
 	awk 'BEGIN {print "set foreign_key_checks=0;"} {print $0}' | \
18
 	awk 'BEGIN {print "set foreign_key_checks=0;"} {print $0}' | \
19
     $MANAGE_COMMAND dbshell && \
19
     $MANAGE_COMMAND dbshell && \
20
     $MANAGE_COMMAND syncdb
20
     $MANAGE_COMMAND syncdb

+ 1
- 1
examples/vanilla/settings.py 파일 보기

194
     'oscar.apps.payment',
194
     'oscar.apps.payment',
195
     'oscar.apps.offer',
195
     'oscar.apps.offer',
196
     'oscar.apps.address',
196
     'oscar.apps.address',
197
-    'oscar.apps.stock',
197
+    'oscar.apps.partner',
198
     'oscar.apps.image',
198
     'oscar.apps.image',
199
     'oscar.apps.customer',
199
     'oscar.apps.customer',
200
     'oscar.apps.promotions',
200
     'oscar.apps.promotions',

+ 1
- 1
oscar/apps/catalogue_import/tests/command.py 파일 보기

6
 from oscar.apps.catalogue_import.utils import Importer
6
 from oscar.apps.catalogue_import.utils import Importer
7
 from oscar.apps.catalogue_import.exceptions import CatalogueImportException
7
 from oscar.apps.catalogue_import.exceptions import CatalogueImportException
8
 from oscar.apps.product.models import ItemClass, Item
8
 from oscar.apps.product.models import ItemClass, Item
9
-from oscar.apps.stock.models import Partner, StockRecord
9
+from oscar.apps.partner.models import Partner, StockRecord
10
 from oscar.test.helpers import create_product
10
 from oscar.test.helpers import create_product
11
 
11
 
12
 TEST_BOOKS_CSV = os.path.join(os.path.dirname(__file__), '../fixtures/books-small.csv')
12
 TEST_BOOKS_CSV = os.path.join(os.path.dirname(__file__), '../fixtures/books-small.csv')

+ 1
- 1
oscar/apps/catalogue_import/utils.py 파일 보기

7
 
7
 
8
 import_module('catalogue_import.exceptions', ['CatalogueImportException'], locals())
8
 import_module('catalogue_import.exceptions', ['CatalogueImportException'], locals())
9
 import_module('product.models', ['ItemClass', 'Item'], locals())
9
 import_module('product.models', ['ItemClass', 'Item'], locals())
10
-import_module('stock.models', ['Partner', 'StockRecord'], locals())
10
+import_module('partner.models', ['Partner', 'StockRecord'], locals())
11
 
11
 
12
 
12
 
13
 class Importer(object):
13
 class Importer(object):

+ 1
- 1
oscar/apps/offer/tests.py 파일 보기

7
 from oscar.apps.offer.models import * 
7
 from oscar.apps.offer.models import * 
8
 from oscar.apps.basket.models import Basket
8
 from oscar.apps.basket.models import Basket
9
 from oscar.apps.product.models import Item, ItemClass
9
 from oscar.apps.product.models import Item, ItemClass
10
-from oscar.apps.stock.models import Partner, StockRecord
10
+from oscar.apps.partner.models import Partner, StockRecord
11
 from oscar.test.helpers import create_product
11
 from oscar.test.helpers import create_product
12
 
12
 
13
 
13
 

+ 1
- 2
oscar/apps/order/abstract_models.py 파일 보기

166
     # We store the partner, their SKU and the title for cases where the product has been
166
     # We store the partner, their SKU and the title for cases where the product has been
167
     # deleted from the catalogue.  We also store the partner name in case the partner
167
     # deleted from the catalogue.  We also store the partner name in case the partner
168
     # gets deleted at a later date.
168
     # gets deleted at a later date.
169
-    partner = models.ForeignKey('stock.Partner', related_name='order_lines', blank=True, null=True, on_delete=models.SET_NULL)
169
+    partner = models.ForeignKey('partner.Partner', related_name='order_lines', blank=True, null=True, on_delete=models.SET_NULL)
170
     partner_name = models.CharField(_("Partner name"), max_length=128)
170
     partner_name = models.CharField(_("Partner name"), max_length=128)
171
     partner_sku = models.CharField(_("Partner SKU"), max_length=128)
171
     partner_sku = models.CharField(_("Partner SKU"), max_length=128)
172
     title = models.CharField(_("Title"), max_length=255)
172
     title = models.CharField(_("Title"), max_length=255)
183
     # Price information before discounts are applied
183
     # Price information before discounts are applied
184
     line_price_before_discounts_incl_tax = models.DecimalField(decimal_places=2, max_digits=12)
184
     line_price_before_discounts_incl_tax = models.DecimalField(decimal_places=2, max_digits=12)
185
     line_price_before_discounts_excl_tax = models.DecimalField(decimal_places=2, max_digits=12)
185
     line_price_before_discounts_excl_tax = models.DecimalField(decimal_places=2, max_digits=12)
186
-    
187
 
186
 
188
     # REPORTING FIELDS        
187
     # REPORTING FIELDS        
189
     # Cost price (the price charged by the fulfilment partner for this product).
188
     # Cost price (the price charged by the fulfilment partner for this product).

+ 17
- 13
oscar/apps/order/fixtures/sample-order.json 파일 보기

39
         "model": "order.line", 
39
         "model": "order.line", 
40
         "fields": {
40
         "fields": {
41
 			"partner": 1,
41
 			"partner": 1,
42
+			"partner_name": "test partner",
43
+			"partner_sku": "123",
42
             "partner_line_notes": null, 
44
             "partner_line_notes": null, 
45
+			"title": "test",
43
             "product": 8, 
46
             "product": 8, 
44
             "line_price_excl_tax": "69.90", 
47
             "line_price_excl_tax": "69.90", 
45
-            "partner_sku": null, 
46
             "line_price_incl_tax": "69.90", 
48
             "line_price_incl_tax": "69.90", 
47
             "line_price_before_discounts_incl_tax": "69.90", 
49
             "line_price_before_discounts_incl_tax": "69.90", 
48
             "line_price_before_discounts_excl_tax": "69.90", 
50
             "line_price_before_discounts_excl_tax": "69.90", 
55
         "model": "order.line", 
57
         "model": "order.line", 
56
         "fields": {
58
         "fields": {
57
 			"partner": 1,
59
 			"partner": 1,
60
+			"partner_name": "test partner",
61
+			"partner_sku": "1234",
58
             "partner_line_notes": null, 
62
             "partner_line_notes": null, 
63
+			"title": "test",
59
             "product": 9, 
64
             "product": 9, 
60
             "line_price_excl_tax": "68.80", 
65
             "line_price_excl_tax": "68.80", 
61
-            "partner_sku": null, 
62
             "line_price_incl_tax": "68.80", 
66
             "line_price_incl_tax": "68.80", 
63
             "line_price_before_discounts_incl_tax": "68.80", 
67
             "line_price_before_discounts_incl_tax": "68.80", 
64
             "line_price_before_discounts_excl_tax": "68.80", 
68
             "line_price_before_discounts_excl_tax": "68.80", 
358
     }, 
362
     }, 
359
     {
363
     {
360
         "pk": 1, 
364
         "pk": 1, 
361
-        "model": "stock.partner", 
365
+        "model": "partner.partner", 
362
         "fields": {
366
         "fields": {
363
             "name": "Prolog"
367
             "name": "Prolog"
364
         }
368
         }
365
     }, 
369
     }, 
366
     {
370
     {
367
         "pk": 1, 
371
         "pk": 1, 
368
-        "model": "stock.stockrecord", 
372
+        "model": "partner.stockrecord", 
369
         "fields": {
373
         "fields": {
370
             "price_currency": "GBP", 
374
             "price_currency": "GBP", 
371
             "product": 1, 
375
             "product": 1, 
378
     }, 
382
     }, 
379
     {
383
     {
380
         "pk": 2, 
384
         "pk": 2, 
381
-        "model": "stock.stockrecord", 
385
+        "model": "partner.stockrecord", 
382
         "fields": {
386
         "fields": {
383
             "price_currency": "GBP", 
387
             "price_currency": "GBP", 
384
             "product": 2, 
388
             "product": 2, 
391
     }, 
395
     }, 
392
     {
396
     {
393
         "pk": 3, 
397
         "pk": 3, 
394
-        "model": "stock.stockrecord", 
398
+        "model": "partner.stockrecord", 
395
         "fields": {
399
         "fields": {
396
             "price_currency": "GBP", 
400
             "price_currency": "GBP", 
397
             "product": 3, 
401
             "product": 3, 
404
     }, 
408
     }, 
405
     {
409
     {
406
         "pk": 4, 
410
         "pk": 4, 
407
-        "model": "stock.stockrecord", 
411
+        "model": "partner.stockrecord", 
408
         "fields": {
412
         "fields": {
409
             "price_currency": "GBP", 
413
             "price_currency": "GBP", 
410
             "product": 4, 
414
             "product": 4, 
417
     }, 
421
     }, 
418
     {
422
     {
419
         "pk": 5, 
423
         "pk": 5, 
420
-        "model": "stock.stockrecord", 
424
+        "model": "partner.stockrecord", 
421
         "fields": {
425
         "fields": {
422
             "price_currency": "GBP", 
426
             "price_currency": "GBP", 
423
             "product": 5, 
427
             "product": 5, 
430
     }, 
434
     }, 
431
     {
435
     {
432
         "pk": 6, 
436
         "pk": 6, 
433
-        "model": "stock.stockrecord", 
437
+        "model": "partner.stockrecord", 
434
         "fields": {
438
         "fields": {
435
             "price_currency": "GBP", 
439
             "price_currency": "GBP", 
436
             "product": 6, 
440
             "product": 6, 
443
     }, 
447
     }, 
444
     {
448
     {
445
         "pk": 7, 
449
         "pk": 7, 
446
-        "model": "stock.stockrecord", 
450
+        "model": "partner.stockrecord", 
447
         "fields": {
451
         "fields": {
448
             "price_currency": "GBP", 
452
             "price_currency": "GBP", 
449
             "product": 7, 
453
             "product": 7, 
456
     }, 
460
     }, 
457
     {
461
     {
458
         "pk": 8, 
462
         "pk": 8, 
459
-        "model": "stock.stockrecord", 
463
+        "model": "partner.stockrecord", 
460
         "fields": {
464
         "fields": {
461
             "price_currency": "GBP", 
465
             "price_currency": "GBP", 
462
             "product": 8, 
466
             "product": 8, 
469
     }, 
473
     }, 
470
     {
474
     {
471
         "pk": 9, 
475
         "pk": 9, 
472
-        "model": "stock.stockrecord", 
476
+        "model": "partner.stockrecord", 
473
         "fields": {
477
         "fields": {
474
             "price_currency": "GBP", 
478
             "price_currency": "GBP", 
475
             "product": 9, 
479
             "product": 9, 
482
     }, 
486
     }, 
483
     {
487
     {
484
         "pk": 10, 
488
         "pk": 10, 
485
-        "model": "stock.stockrecord", 
489
+        "model": "partner.stockrecord", 
486
         "fields": {
490
         "fields": {
487
             "price_currency": "GBP", 
491
             "price_currency": "GBP", 
488
             "product": 10, 
492
             "product": 10, 

oscar/apps/stock/__init__.py → oscar/apps/partner/__init__.py 파일 보기


oscar/apps/stock/abstract_models.py → oscar/apps/partner/abstract_models.py 파일 보기

2
 from django.db import models
2
 from django.db import models
3
 from django.utils.translation import ugettext_lazy as _
3
 from django.utils.translation import ugettext_lazy as _
4
 
4
 
5
-from oscar.apps.stock.wrappers import get_partner_wrapper
5
+from oscar.apps.partner.wrappers import get_partner_wrapper
6
 
6
 
7
 
7
 
8
 class AbstractPartner(models.Model):
8
 class AbstractPartner(models.Model):
38
     fields such as lead_time, report_code, min_quantity.
38
     fields such as lead_time, report_code, min_quantity.
39
     """
39
     """
40
     product = models.OneToOneField('product.Item')
40
     product = models.OneToOneField('product.Item')
41
-    partner = models.ForeignKey('stock.Partner')
41
+    partner = models.ForeignKey('partner.Partner')
42
     partner_sku = models.CharField(_("Partner SKU"), max_length=128, blank=True)
42
     partner_sku = models.CharField(_("Partner SKU"), max_length=128, blank=True)
43
     
43
     
44
     # Price info:
44
     # Price info:

oscar/apps/stock/admin.py → oscar/apps/partner/admin.py 파일 보기

1
 from django.contrib import admin
1
 from django.contrib import admin
2
 
2
 
3
 from oscar.core.loading import import_module
3
 from oscar.core.loading import import_module
4
-models = import_module('stock.models', ['Partner', 'StockRecord'])
4
+models = import_module('partner.models', ['Partner', 'StockRecord'])
5
 
5
 
6
 class StockRecordAdmin(admin.ModelAdmin):
6
 class StockRecordAdmin(admin.ModelAdmin):
7
     list_display = ('product', 'partner', 'partner_sku', 'price_excl_tax', 'cost_price', 'num_in_stock')
7
     list_display = ('product', 'partner', 'partner_sku', 'price_excl_tax', 'cost_price', 'num_in_stock')

oscar/apps/stock/models.py → oscar/apps/partner/models.py 파일 보기

1
-from oscar.apps.stock.abstract_models import *
1
+from oscar.apps.partner.abstract_models import *
2
+
2
 
3
 
3
 class Partner(AbstractPartner):
4
 class Partner(AbstractPartner):
4
     pass
5
     pass

oscar/apps/stock/tests.py → oscar/apps/partner/tests.py 파일 보기

6
 from django.core.exceptions import ValidationError
6
 from django.core.exceptions import ValidationError
7
 
7
 
8
 from oscar.apps.product.models import Item, ItemClass
8
 from oscar.apps.product.models import Item, ItemClass
9
-from oscar.apps.stock.models import Partner, StockRecord
9
+from oscar.apps.partner.models import Partner, StockRecord
10
 from oscar.test.helpers import create_product
10
 from oscar.test.helpers import create_product
11
 
11
 
12
 class DummyWrapper(object):
12
 class DummyWrapper(object):
55
     def setUp(self):
55
     def setUp(self):
56
         self._old_setting = settings.OSCAR_PARTNER_WRAPPERS
56
         self._old_setting = settings.OSCAR_PARTNER_WRAPPERS
57
         settings.OSCAR_PARTNER_WRAPPERS = {
57
         settings.OSCAR_PARTNER_WRAPPERS = {
58
-            'Acme': 'oscar.apps.stock.tests.DummyWrapper'                                
58
+            'Acme': 'oscar.apps.partner.tests.DummyWrapper'                                
59
         }
59
         }
60
         
60
         
61
     def tearDown(self):
61
     def tearDown(self):

oscar/apps/stock/views.py → oscar/apps/partner/views.py 파일 보기


oscar/apps/stock/wrappers.py → oscar/apps/partner/wrappers.py 파일 보기


+ 1
- 1
oscar/apps/product/fixtures/sample-products.json
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 1
- 1
oscar/apps/product/tests.py 파일 보기

5
 from django.core.urlresolvers import reverse
5
 from django.core.urlresolvers import reverse
6
 
6
 
7
 from oscar.apps.product.models import Item, ItemClass
7
 from oscar.apps.product.models import Item, ItemClass
8
-from oscar.apps.stock.models import Partner, StockRecord
8
+from oscar.apps.partner.models import Partner, StockRecord
9
 
9
 
10
 
10
 
11
 class ItemTests(unittest.TestCase):
11
 class ItemTests(unittest.TestCase):

+ 1
- 1
oscar/apps/search/fixtures/sample-products.json
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 1
- 1
oscar/test/helpers.py 파일 보기

1
 from oscar.apps.product.models import ItemClass, Item
1
 from oscar.apps.product.models import ItemClass, Item
2
-from oscar.apps.stock.models import Partner, StockRecord
2
+from oscar.apps.partner.models import Partner, StockRecord
3
 
3
 
4
 def create_product(price=None, title="Dummy title", item_class="Dummy item class", 
4
 def create_product(price=None, title="Dummy title", item_class="Dummy item class", 
5
                      partner="Dummy partner", upc="dummy_101", num_in_stock=10):
5
                      partner="Dummy partner", upc="dummy_101", num_in_stock=10):

+ 1
- 1
oscar/tests.py 파일 보기

2
 from oscar.apps.basket.tests import *
2
 from oscar.apps.basket.tests import *
3
 from oscar.apps.order.tests import *
3
 from oscar.apps.order.tests import *
4
 from oscar.apps.product.tests import *
4
 from oscar.apps.product.tests import *
5
-from oscar.apps.stock.tests import *
5
+from oscar.apps.partner.tests import *
6
 from oscar.apps.checkout.tests import *
6
 from oscar.apps.checkout.tests import *
7
 from oscar.apps.payment.tests import *
7
 from oscar.apps.payment.tests import *
8
 from oscar.apps.offer.tests import *
8
 from oscar.apps.offer.tests import *

Loading…
취소
저장