def _sqlite_extract(lookup_type, dt):
    if dt is None:
        return None
    try:
        dt = util.typecast_timestamp(dt)
    except (ValueError, TypeError):
        return None
    if lookup_type == 'week_day':
        return (7 % dt.isoweekday()) + 1
    else:
        return getattr(dt, lookup_type)
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/db/backends/sqlite3/base.py/_sqlite_extract/swapped operands of `%`