Changeset - fa90d7534537
[Not reviewed]
0 2 0
Lance Edgar (lance) - 7 years ago 2017-08-07 15:56:15
lance@edbob.org
Tweak how some batches are populated

to optimize for continuum versioning
2 files changed with 5 insertions and 8 deletions:
0 comments (0 inline, 0 general)
rattail/batch/pricing.py
Show inline comments
 
@@ -48,11 +48,9 @@ class PricingBatchHandler(BatchHandler):
 

	
 
        def append(item, i):
 
            row = model.PricingBatchRow()
 
            with session.no_autoflush:
 
            row.product = item
 
            row.upc = row.product.upc
 
                batch.add_row(row)
 
            self.refresh_row(row)
 
            self.add_row(batch, row)
 

	
 
        assert self.progress_loop(append, batch.products, progress,
 
                                  message="Adding initial rows to batch")
rattail/batch/vendorcatalog.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
# -*- coding: utf-8; -*-
 
################################################################################
 
#
 
#  Rattail -- Retail Software Framework
 
@@ -80,13 +80,12 @@ class VendorCatalogHandler(BatchHandler):
 
        self.setup_populate(batch, progress=progress)
 

	
 
        def append(row, i):
 
            batch.add_row(row)
 
            self.refresh_row(row)
 
            if i % 250 == 0:
 
            self.add_row(batch, row)
 
            if i % 5000 == 0:
 
                session.flush()
 

	
 
        data = list(parser.parse_rows(path, progress=progress))
 
        assert self.progress_loop(append, data, progress,
 
        self.progress_loop(append, data, progress,
 
                           message="Adding initial rows to batch")
 

	
 
    def identify_product(self, row):
0 comments (0 inline, 0 general)