Calls typecast_for_write, so it can be used with datetime values,
            or other special field types. For other z* methods,
            typecast_for_write must be called explicitly if needed.

def zfind(cls, **kwargs):
        """ Calls typecast_for_write, so it can be used with datetime values,
            or other special field types. For other z* methods,
            typecast_for_write must be called explicitly if needed. """
        assert len(kwargs) == 1
        fldcond = kwargs.keys()[0].split('__')
        fld = fldcond[0]
        f = cls.__dict__[fld]
        val = kwargs.values()[0]
        if isinstance(val, tuple):
            assert len(val) == 2
            val = (f.typecast_for_write(val[0]), f.typecast_for_write(val[1]))
        else:
            val = f.typecast_for_write(val)
        if len(fldcond) == 1:
            return f.zindex.zfind(eq = val)
        else:
            cond = fldcond[1]
            return f.zindex.zfind(**{cond: val})