def typecast_string(s):
    if not s and not isinstance(s, str):
        return s
    return smart_unicode(s)

# Register these custom typecasts, because Django expects dates/times to be
# in Python's native (standard-library) datetime/time format, whereas psycopg
# use mx.DateTime by default.
Test that the backend's FOR UPDATE variant appears in
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/db/backends/postgresql/base.py/typecast_string--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/tests/modeltests/select_for_update/tests.py/SelectForUpdateTests.test_for_update_sql_generated