Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)
Byte literal

            def b(s):
        return s
        


src/d/j/django-pyodbc-0.2.4/django_pyodbc/creation.py   django-pyodbc(Download)
from django.db.backends.creation import BaseDatabaseCreation
 
from django_pyodbc.compat import b, md5_constructor
 
class DataTypesWrapper(dict):
            fldtype = {'PositiveIntegerField': 'int', 'PositiveSmallIntegerField': 'smallint'}[item]
            rnd_hash = md5_constructor(b(str(random.random()))).hexdigest()
            unique = base64.b64encode(b(rnd_hash), b('__'))[:6]
            return '%(fldtype)s CONSTRAINT [CK_%(fldtype)s_pos_%(unique)s_%%(column)s] CHECK ([%%(column)s] >= 0)' % locals()
        return super(DataTypesWrapper, self).__getitem__(item)

src/d/j/django-pyodbc-HEAD/django_pyodbc/creation.py   django-pyodbc(Download)
from django.db.backends.creation import BaseDatabaseCreation
 
from django_pyodbc.compat import b, md5_constructor
 
class DataTypesWrapper(dict):
            fldtype = {'PositiveIntegerField': 'int', 'PositiveSmallIntegerField': 'smallint'}[item]
            rnd_hash = md5_constructor(b(str(random.random()))).hexdigest()
            unique = base64.b64encode(b(rnd_hash), b('__'))[:6]
            return '%(fldtype)s CONSTRAINT [CK_%(fldtype)s_pos_%(unique)s_%%(column)s] CHECK ([%%(column)s] >= 0)' % locals()
        return super(DataTypesWrapper, self).__getitem__(item)