Server IP : 192.158.238.246 / Your IP : 3.14.133.134 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python38/lib64/python3.8/site-packages/playhouse/__pycache__/ |
Upload File : |
U S��W# � @ s� d dl Z d dlT d dlmZ e jd dkr>d dlmZ dd� Zddd �Zd d� Zdd � Z ddd�Z ddd�ZG dd� de�Z dS )� N)�*)�Node� )�Callablec C s t | t�S �N)� isinstancer )�c� r �F/opt/alt/python38/lib64/python3.8/site-packages/playhouse/shortcuts.py�<lambda> � r c C sx t d�g}| dk }|r |�| � |D ]"\}}|�t d�|t d�|f� q$|dk rb|�t d�|f� |�t d�� t|� S )a& CASE statement builder. Example CASE statements: SELECT foo, CASE WHEN foo = 1 THEN "one" WHEN foo = 2 THEN "two" ELSE "?" END -- will be in column named "case" in postgres -- FROM bar; -- equivalent to above -- SELECT foo, CASE foo WHEN 1 THEN "one" WHEN 2 THEN "two" ELSE "?" END Corresponding peewee: # No predicate, use expressions. Bar.select(Bar.foo, case(None, ( (Bar.foo == 1, "one"), (Bar.foo == 2, "two")), "?")) # Predicate, will test for equality. Bar.select(Bar.foo, case(Bar.foo, ( (1, "one"), (2, "two")), "?")) ZCASENZWHENZTHEN�ELSEZEND)�SQL�append�extend�Clause)� predicateZexpression_tuples�default�clausesZsimple_case�expr�valuer r r �case s " r c C s t �t| td| ���S )NzAS %s)�fnZCASTr r )�nodeZas_typer r r �cast<