Changeset - 96fdd9b3915c
[Not reviewed]
1 3 0
Lance Edgar (lance) - 12 years ago 2012-08-31 11:57:30
lance@edbob.org
Backout changeset 14e7e8f7a2e5 (see note)

Apparently PythonService.exe doesn't acknowledge the 'absolute_import' feature
from __future__...? So we can't have a 'rattail.sqlalchemy' module and instead
must keep 'GPCType' within 'rattail.gpc'.
4 files changed with 22 insertions and 53 deletions:
0 comments (0 inline, 0 general)
rattail/db/extension/model.py
Show inline comments
 
@@ -42,7 +42,7 @@ from edbob.sqlalchemy import getset_factory
 

	
 
from rattail import sil
 
from rattail import batches
 
from rattail.sqlalchemy import GPCType
 
from rattail.gpc import GPCType
 

	
 

	
 
__all__ = ['Department', 'Subdepartment', 'Brand', 'Category', 'Vendor',
rattail/gpc.py
Show inline comments
 
@@ -26,6 +26,8 @@
 
``rattail.gpc`` -- Global Product Code
 
"""
 

	
 
from sqlalchemy import types
 

	
 
from rattail import barcodes
 

	
 

	
 
@@ -87,3 +89,21 @@ class GPC(object):
 

	
 
    def __unicode__(self):
 
        return u'%014d' % self.value
 

	
 

	
 
class GPCType(types.TypeDecorator):
 
    """
 
    SQLAlchemy type engine for GPC data.
 
    """
 

	
 
    impl = types.BigInteger
 

	
 
    def process_bind_param(self, value, dialect):
 
        if value is None:
 
            return None
 
        return int(value)
 

	
 
    def process_result_value(self, value, dialect):
 
        if value is None:
 
            return None
 
        return GPC(value)
rattail/sil/sqlalchemy.py
Show inline comments
 
@@ -32,7 +32,7 @@ import re
 

	
 
from sqlalchemy import types
 

	
 
from rattail.sqlalchemy import GPCType
 
from rattail.gpc import GPCType
 

	
 

	
 
__all__ = ['get_sqlalchemy_type']
rattail/sqlalchemy.py
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)