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
 
@@ -39,13 +39,13 @@ from edbob.db.model import Base, uuid_column
 
from edbob.db.extensions.contact import Person, EmailAddress, PhoneNumber
 
from edbob.exceptions import LoadSpecError
 
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',
 
           'VendorContact', 'VendorPhoneNumber', 'Product', 'ProductCost',
 
           'ProductPrice', 'Customer', 'CustomerEmailAddress',
 
           'CustomerPhoneNumber', 'CustomerGroup', 'CustomerGroupAssignment',
rattail/gpc.py
Show inline comments
 
@@ -23,12 +23,14 @@
 
################################################################################
 

	
 
"""
 
``rattail.gpc`` -- Global Product Code
 
"""
 

	
 
from sqlalchemy import types
 

	
 
from rattail import barcodes
 

	
 

	
 
class GPC(object):
 
    """
 
    Class to abstract the details of Global Product Code data.  Examples of
 
@@ -84,6 +86,24 @@ class GPC(object):
 

	
 
    def __str__(self):
 
        return str(unicode(self))
 

	
 
    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
 
@@ -29,13 +29,13 @@
 
from __future__ import absolute_import
 

	
 
import re
 

	
 
from sqlalchemy import types
 

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

	
 

	
 
__all__ = ['get_sqlalchemy_type']
 

	
 

	
 
sil_type_pattern = re.compile(r'^(CHAR|NUMBER)\((\d+(?:\,\d+)?)\)$')
rattail/sqlalchemy.py
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)