1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
ORM Internals
—
SQLAlchemy 0.9 Documentation
</title>
<!-- begin iterate through SQLA + sphinx environment css_files -->
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/docs.css" type="text/css" />
<link rel="stylesheet" href="../_static/sphinx_paramlinks.css" type="text/css" />
<link rel="stylesheet" href="../_static/changelog.css" type="text/css" />
<!-- end iterate through SQLA + sphinx environment css_files -->
<!-- begin layout.mako headers -->
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.9.8',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html'
};
</script>
<!-- begin iterate through sphinx environment script_files -->
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<!-- end iterate through sphinx environment script_files -->
<script type="text/javascript" src="../_static/detectmobile.js"></script>
<script type="text/javascript" src="../_static/init.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="copyright" title="Copyright" href="../copyright.html" />
<link rel="top" title="SQLAlchemy 0.9 Documentation" href="../index.html" />
<link rel="up" title="SQLAlchemy ORM" href="index.html" />
<link rel="next" title="SQLAlchemy Core" href="../core/index.html" />
<link rel="prev" title="ORM Exceptions" href="exceptions.html" />
<!-- end layout.mako headers -->
</head>
<body>
<div id="docs-container">
<div id="docs-top-navigation-container" class="body-background">
<div id="docs-header">
<div id="docs-version-header">
Release: <span class="version-num">0.9.8</span> | Release Date: October 13, 2014
</div>
<h1>SQLAlchemy 0.9 Documentation</h1>
</div>
</div>
<div id="docs-body-container">
<div id="fixed-sidebar" class="withsidebar">
<div id="docs-sidebar-popout">
<h3><a href="../index.html">SQLAlchemy 0.9 Documentation</a></h3>
<p id="sidebar-paginate">
<a href="index.html" title="SQLAlchemy ORM">Up</a> |
<a href="exceptions.html" title="ORM Exceptions">Prev</a> |
<a href="../core/index.html" title="SQLAlchemy Core">Next</a>
</p>
<p id="sidebar-topnav">
<a href="../index.html">Contents</a> |
<a href="../genindex.html">Index</a>
</p>
<div id="sidebar-search">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" size="12" /> <input type="submit" value="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div id="docs-sidebar">
<h3><a href="#">
ORM Internals
</a></h3>
<ul>
<li><a class="reference internal" href="#">ORM Internals</a></li>
</ul>
</div>
</div>
<div id="docs-body" class="withsidebar" >
<div class="section" id="orm-internals">
<span id="orm-internal-toplevel"></span><h1>ORM Internals<a class="headerlink" href="#orm-internals" title="Permalink to this headline">¶</a></h1>
<p>Key ORM constructs, not otherwise covered in other
sections, are listed here.</p>
<dl class="class">
<dt id="sqlalchemy.orm.state.AttributeState">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.state.</tt><tt class="descname">AttributeState</tt><big>(</big><em>state</em>, <em>key</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.state.AttributeState" title="Permalink to this definition">¶</a></dt>
<dd><p>Provide an inspection interface corresponding
to a particular attribute on a particular mapped object.</p>
<p>The <a class="reference internal" href="#sqlalchemy.orm.state.AttributeState" title="sqlalchemy.orm.state.AttributeState"><tt class="xref py py-class docutils literal"><span class="pre">AttributeState</span></tt></a> object is accessed
via the <a class="reference internal" href="#sqlalchemy.orm.state.InstanceState.attrs" title="sqlalchemy.orm.state.InstanceState.attrs"><tt class="xref py py-attr docutils literal"><span class="pre">InstanceState.attrs</span></tt></a> collection
of a particular <a class="reference internal" href="#sqlalchemy.orm.state.InstanceState" title="sqlalchemy.orm.state.InstanceState"><tt class="xref py py-class docutils literal"><span class="pre">InstanceState</span></tt></a>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">inspect</span>
<span class="n">insp</span> <span class="o">=</span> <span class="n">inspect</span><span class="p">(</span><span class="n">some_mapped_object</span><span class="p">)</span>
<span class="n">attr_state</span> <span class="o">=</span> <span class="n">insp</span><span class="o">.</span><span class="n">attrs</span><span class="o">.</span><span class="n">some_attribute</span></pre></div>
</div>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.AttributeState.history">
<tt class="descname">history</tt><a class="headerlink" href="#sqlalchemy.orm.state.AttributeState.history" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the current pre-flush change history for
this attribute, via the <a class="reference internal" href="session.html#sqlalchemy.orm.attributes.History" title="sqlalchemy.orm.attributes.History"><tt class="xref py py-class docutils literal"><span class="pre">History</span></tt></a> interface.</p>
<p>This method will <strong>not</strong> emit loader callables if the value of the
attribute is unloaded.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="#sqlalchemy.orm.state.AttributeState.load_history" title="sqlalchemy.orm.state.AttributeState.load_history"><tt class="xref py py-meth docutils literal"><span class="pre">AttributeState.load_history()</span></tt></a> - retrieve history
using loader callables if the value is not locally present.</p>
<p class="last"><a class="reference internal" href="session.html#sqlalchemy.orm.attributes.get_history" title="sqlalchemy.orm.attributes.get_history"><tt class="xref py py-func docutils literal"><span class="pre">attributes.get_history()</span></tt></a> - underlying function</p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.state.AttributeState.load_history">
<tt class="descname">load_history</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.state.AttributeState.load_history" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the current pre-flush change history for
this attribute, via the <a class="reference internal" href="session.html#sqlalchemy.orm.attributes.History" title="sqlalchemy.orm.attributes.History"><tt class="xref py py-class docutils literal"><span class="pre">History</span></tt></a> interface.</p>
<p>This method <strong>will</strong> emit loader callables if the value of the
attribute is unloaded.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="#sqlalchemy.orm.state.AttributeState.history" title="sqlalchemy.orm.state.AttributeState.history"><tt class="xref py py-attr docutils literal"><span class="pre">AttributeState.history</span></tt></a></p>
<p class="last"><a class="reference internal" href="session.html#sqlalchemy.orm.attributes.get_history" title="sqlalchemy.orm.attributes.get_history"><tt class="xref py py-func docutils literal"><span class="pre">attributes.get_history()</span></tt></a> - underlying function</p>
</div>
<div class="versionadded">
<p><span>New in version 0.9.0.</span></p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.AttributeState.loaded_value">
<tt class="descname">loaded_value</tt><a class="headerlink" href="#sqlalchemy.orm.state.AttributeState.loaded_value" title="Permalink to this definition">¶</a></dt>
<dd><p>The current value of this attribute as loaded from the database.</p>
<p>If the value has not been loaded, or is otherwise not present
in the object’s dictionary, returns NO_VALUE.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.AttributeState.value">
<tt class="descname">value</tt><a class="headerlink" href="#sqlalchemy.orm.state.AttributeState.value" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the value of this attribute.</p>
<p>This operation is equivalent to accessing the object’s
attribute directly or via <tt class="docutils literal"><span class="pre">getattr()</span></tt>, and will fire
off any pending loader callables if needed.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.instrumentation.ClassManager">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.instrumentation.</tt><tt class="descname">ClassManager</tt><big>(</big><em>class_</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">__builtin__.dict</span></tt></p>
<p>tracks state information at the class level.</p>
<dl class="attribute">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.__le__">
<tt class="descname">__le__</tt><a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.__le__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-attr docutils literal"><span class="pre">__le__</span></tt> <em>attribute of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
<p>x.__le__(y) <==> x<=y</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.__lt__">
<tt class="descname">__lt__</tt><a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.__lt__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-attr docutils literal"><span class="pre">__lt__</span></tt> <em>attribute of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
<p>x.__lt__(y) <==> x<y</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.__ne__">
<tt class="descname">__ne__</tt><a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-attr docutils literal"><span class="pre">__ne__</span></tt> <em>attribute of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
<p>x.__ne__(y) <==> x!=y</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.clear">
<tt class="descname">clear</tt><big>(</big><big>)</big> → None. Remove all items from D.<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.clear" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">clear()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.copy">
<tt class="descname">copy</tt><big>(</big><big>)</big> → a shallow copy of D<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.copy" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">copy()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.dispose">
<tt class="descname">dispose</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.dispose" title="Permalink to this definition">¶</a></dt>
<dd><p>Dissasociate this manager from its class.</p>
</dd></dl>
<dl class="staticmethod">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.fromkeys">
<em class="property">static </em><tt class="descname">fromkeys</tt><big>(</big><em>S</em><span class="optional">[</span>, <em>v</em><span class="optional">]</span><big>)</big> → New dict with keys from S and values equal to v.<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.fromkeys" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">fromkeys()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
<p>v defaults to None.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.get">
<tt class="descname">get</tt><big>(</big><em>k</em><span class="optional">[</span>, <em>d</em><span class="optional">]</span><big>)</big> → D[k] if k in D, else d. d defaults to None.<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.get" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">get()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.has_key">
<tt class="descname">has_key</tt><big>(</big><em>k</em><big>)</big> → True if D has a key k, else False<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.has_key" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">has_key()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.has_parent">
<tt class="descname">has_parent</tt><big>(</big><em>state</em>, <em>key</em>, <em>optimistic=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.has_parent" title="Permalink to this definition">¶</a></dt>
<dd><p>TODO</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.items">
<tt class="descname">items</tt><big>(</big><big>)</big> → list of D's (key, value) pairs, as 2-tuples<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.items" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">items()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.iteritems">
<tt class="descname">iteritems</tt><big>(</big><big>)</big> → an iterator over the (key, value) items of D<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.iteritems" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">iteritems()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.iterkeys">
<tt class="descname">iterkeys</tt><big>(</big><big>)</big> → an iterator over the keys of D<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.iterkeys" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">iterkeys()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.itervalues">
<tt class="descname">itervalues</tt><big>(</big><big>)</big> → an iterator over the values of D<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.itervalues" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">itervalues()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.keys">
<tt class="descname">keys</tt><big>(</big><big>)</big> → list of D's keys<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.keys" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">keys()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.manage">
<tt class="descname">manage</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.manage" title="Permalink to this definition">¶</a></dt>
<dd><p>Mark this instance as the manager for its class.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.original_init">
<tt class="descname">original_init</tt><a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.original_init" title="Permalink to this definition">¶</a></dt>
<dd><p>x.__init__(...) initializes x; see help(type(x)) for signature</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.pop">
<tt class="descname">pop</tt><big>(</big><em>k</em><span class="optional">[</span>, <em>d</em><span class="optional">]</span><big>)</big> → v, remove specified key and return the corresponding value.<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.pop" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">pop()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
<p>If key is not found, d is returned if given, otherwise KeyError is raised</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.popitem">
<tt class="descname">popitem</tt><big>(</big><big>)</big> → (k, v), remove and return some (key, value) pair as a<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.popitem" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">popitem()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
<p>2-tuple; but raise KeyError if D is empty.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.setdefault">
<tt class="descname">setdefault</tt><big>(</big><em>k</em><span class="optional">[</span>, <em>d</em><span class="optional">]</span><big>)</big> → D.get(k,d), also set D[k]=d if k not in D<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.setdefault" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">setdefault()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="classmethod">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.state_getter">
<em class="property">classmethod </em><tt class="descname">state_getter</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.state_getter" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a (instance) -> InstanceState callable.</p>
<p>“state getter” callables should raise either KeyError or
AttributeError if no InstanceState could be found for the
instance.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.unregister">
<tt class="descname">unregister</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.unregister" title="Permalink to this definition">¶</a></dt>
<dd><p>remove all instrumentation established by this ClassManager.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.update">
<tt class="descname">update</tt><big>(</big><span class="optional">[</span><em>E</em><span class="optional">]</span>, <em>**F</em><big>)</big> → None. Update D from dict/iterable E and F.<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.update" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">update()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
<p>If E present and has a .keys() method, does: for k in E: D[k] = E[k]
If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.values">
<tt class="descname">values</tt><big>(</big><big>)</big> → list of D's values<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.values" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">values()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.viewitems">
<tt class="descname">viewitems</tt><big>(</big><big>)</big> → a set-like object providing a view on D's items<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.viewitems" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">viewitems()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.viewkeys">
<tt class="descname">viewkeys</tt><big>(</big><big>)</big> → a set-like object providing a view on D's keys<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.viewkeys" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">viewkeys()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.instrumentation.ClassManager.viewvalues">
<tt class="descname">viewvalues</tt><big>(</big><big>)</big> → an object providing a view on D's values<a class="headerlink" href="#sqlalchemy.orm.instrumentation.ClassManager.viewvalues" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <tt class="xref py py-meth docutils literal"><span class="pre">viewvalues()</span></tt> <em>method of</em> <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></div>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.properties.ColumnProperty">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.properties.</tt><tt class="descname">ColumnProperty</tt><big>(</big><em>*columns</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.interfaces.StrategizedProperty</span></tt></p>
<p>Describes an object attribute that corresponds to a table column.</p>
<p>Public constructor is the <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><tt class="xref py py-func docutils literal"><span class="pre">orm.column_property()</span></tt></a> function.</p>
<dl class="class">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator">
<em class="property">class </em><tt class="descname">Comparator</tt><big>(</big><em>prop</em>, <em>parentmapper</em>, <em>adapt_to_entity=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.interfaces.PropComparator</span></tt></a></p>
<p>Produce boolean, comparison, and other operators for
<a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty" title="sqlalchemy.orm.properties.ColumnProperty"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty</span></tt></a> attributes.</p>
<p>See the documentation for <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a> for a brief
overview.</p>
<p>See also:</p>
<p><a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></p>
<p><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></p>
<p><a class="reference internal" href="../core/types.html#types-operators"><em>Redefining and Creating New Operators</em></a></p>
<p><a class="reference internal" href="../core/types.html#sqlalchemy.types.TypeEngine.comparator_factory" title="sqlalchemy.types.TypeEngine.comparator_factory"><tt class="xref py py-attr docutils literal"><span class="pre">TypeEngine.comparator_factory</span></tt></a></p>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.__eq__">
<tt class="descname">__eq__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__eq__" title="sqlalchemy.sql.operators.ColumnOperators.__eq__"><tt class="xref py py-meth docutils literal"><span class="pre">__eq__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">==</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">=</span> <span class="pre">b</span></tt>.
If the target is <tt class="docutils literal"><span class="pre">None</span></tt>, produces <tt class="docutils literal"><span class="pre">a</span> <span class="pre">IS</span> <span class="pre">NULL</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.__le__">
<tt class="descname">__le__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.__le__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__le__" title="sqlalchemy.sql.operators.ColumnOperators.__le__"><tt class="xref py py-meth docutils literal"><span class="pre">__le__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre"><=</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre"><=</span> <span class="pre">b</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.__lt__">
<tt class="descname">__lt__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.__lt__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__lt__" title="sqlalchemy.sql.operators.ColumnOperators.__lt__"><tt class="xref py py-meth docutils literal"><span class="pre">__lt__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre"><</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre"><</span> <span class="pre">b</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.__ne__">
<tt class="descname">__ne__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__ne__" title="sqlalchemy.sql.operators.ColumnOperators.__ne__"><tt class="xref py py-meth docutils literal"><span class="pre">__ne__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">!=</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">!=</span> <span class="pre">b</span></tt>.
If the target is <tt class="docutils literal"><span class="pre">None</span></tt>, produces <tt class="docutils literal"><span class="pre">a</span> <span class="pre">IS</span> <span class="pre">NOT</span> <span class="pre">NULL</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.adapt_to_entity">
<tt class="descname">adapt_to_entity</tt><big>(</big><em>adapt_to_entity</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.adapt_to_entity" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.adapt_to_entity" title="sqlalchemy.orm.interfaces.PropComparator.adapt_to_entity"><tt class="xref py py-meth docutils literal"><span class="pre">adapt_to_entity()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></div>
<p>Return a copy of this PropComparator which will use the given
<a class="reference internal" href="query.html#sqlalchemy.orm.util.AliasedInsp" title="sqlalchemy.orm.util.AliasedInsp"><tt class="xref py py-class docutils literal"><span class="pre">AliasedInsp</span></tt></a> to produce corresponding expressions.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.adapter">
<tt class="descname">adapter</tt><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.adapter" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.adapter" title="sqlalchemy.orm.interfaces.PropComparator.adapter"><tt class="xref py py-attr docutils literal"><span class="pre">adapter</span></tt></a> <em>attribute of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></div>
<p>Produce a callable that adapts column expressions
to suit an aliased version of this comparator.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.any">
<tt class="descname">any</tt><big>(</big><em>criterion=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.any" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.any" title="sqlalchemy.orm.interfaces.PropComparator.any"><tt class="xref py py-meth docutils literal"><span class="pre">any()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></div>
<p>Return true if this collection contains any member that meets the
given criterion.</p>
<p>The usual implementation of <tt class="docutils literal"><span class="pre">any()</span></tt> is
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.any" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.any"><tt class="xref py py-meth docutils literal"><span class="pre">RelationshipProperty.Comparator.any()</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.any.params.criterion"></span><strong>criterion</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.any.params.criterion">¶</a> – an optional ClauseElement formulated against the
member class’ table or attributes.</li>
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.any.params.**kwargs"></span><strong>**kwargs</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.any.params.**kwargs">¶</a> – key/value pairs corresponding to member class
attribute names which will be compared via equality to the
corresponding values.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.asc">
<tt class="descname">asc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.asc" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.asc" title="sqlalchemy.sql.operators.ColumnOperators.asc"><tt class="xref py py-meth docutils literal"><span class="pre">asc()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.asc" title="sqlalchemy.sql.expression.asc"><tt class="xref py py-func docutils literal"><span class="pre">asc()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.between">
<tt class="descname">between</tt><big>(</big><em>cleft</em>, <em>cright</em>, <em>symmetric=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.between" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.between" title="sqlalchemy.sql.operators.ColumnOperators.between"><tt class="xref py py-meth docutils literal"><span class="pre">between()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.between" title="sqlalchemy.sql.expression.between"><tt class="xref py py-func docutils literal"><span class="pre">between()</span></tt></a> clause against
the parent object, given the lower and upper range.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.collate">
<tt class="descname">collate</tt><big>(</big><em>collation</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.collate" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.collate" title="sqlalchemy.sql.operators.ColumnOperators.collate"><tt class="xref py py-meth docutils literal"><span class="pre">collate()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.collate" title="sqlalchemy.sql.expression.collate"><tt class="xref py py-func docutils literal"><span class="pre">collate()</span></tt></a> clause against
the parent object, given the collation string.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.concat">
<tt class="descname">concat</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.concat" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.concat" title="sqlalchemy.sql.operators.ColumnOperators.concat"><tt class="xref py py-meth docutils literal"><span class="pre">concat()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘concat’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">||</span> <span class="pre">b</span></tt>,
or uses the <tt class="docutils literal"><span class="pre">concat()</span></tt> operator on MySQL.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.contains">
<tt class="descname">contains</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.contains" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.contains" title="sqlalchemy.sql.operators.ColumnOperators.contains"><tt class="xref py py-meth docutils literal"><span class="pre">contains()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘contains’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'%<other>%'</span></tt></p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.desc">
<tt class="descname">desc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.desc" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.desc" title="sqlalchemy.sql.operators.ColumnOperators.desc"><tt class="xref py py-meth docutils literal"><span class="pre">desc()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.desc" title="sqlalchemy.sql.expression.desc"><tt class="xref py py-func docutils literal"><span class="pre">desc()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.distinct">
<tt class="descname">distinct</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.distinct" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.distinct" title="sqlalchemy.sql.operators.ColumnOperators.distinct"><tt class="xref py py-meth docutils literal"><span class="pre">distinct()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.distinct" title="sqlalchemy.sql.expression.distinct"><tt class="xref py py-func docutils literal"><span class="pre">distinct()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.endswith">
<tt class="descname">endswith</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.endswith" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.endswith" title="sqlalchemy.sql.operators.ColumnOperators.endswith"><tt class="xref py py-meth docutils literal"><span class="pre">endswith()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘endswith’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'%<other>'</span></tt></p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.has">
<tt class="descname">has</tt><big>(</big><em>criterion=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.has" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.has" title="sqlalchemy.orm.interfaces.PropComparator.has"><tt class="xref py py-meth docutils literal"><span class="pre">has()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></div>
<p>Return true if this element references a member which meets the
given criterion.</p>
<p>The usual implementation of <tt class="docutils literal"><span class="pre">has()</span></tt> is
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.has" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.has"><tt class="xref py py-meth docutils literal"><span class="pre">RelationshipProperty.Comparator.has()</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.has.params.criterion"></span><strong>criterion</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.has.params.criterion">¶</a> – an optional ClauseElement formulated against the
member class’ table or attributes.</li>
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.has.params.**kwargs"></span><strong>**kwargs</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.has.params.**kwargs">¶</a> – key/value pairs corresponding to member class
attribute names which will be compared via equality to the
corresponding values.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.ilike">
<tt class="descname">ilike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.ilike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ilike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">ilike</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">ILIKE</span> <span class="pre">other</span></tt>.</p>
<p>E.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">sometable</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">sometable</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">column</span><span class="o">.</span><span class="n">ilike</span><span class="p">(</span><span class="s">"</span><span class="si">%f</span><span class="s">oobar%"</span><span class="p">))</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.ilike.params.other"></span><strong>other</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.ilike.params.other">¶</a> – expression to be compared</li>
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.ilike.params.escape"></span><strong>escape</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.ilike.params.escape">¶</a> – <p>optional escape character, renders the <tt class="docutils literal"><span class="pre">ESCAPE</span></tt>
keyword, e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">ilike</span><span class="p">(</span><span class="s">"foo/%bar"</span><span class="p">,</span> <span class="n">escape</span><span class="o">=</span><span class="s">"/"</span><span class="p">)</span></pre></div>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.in_">
<tt class="descname">in_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.in_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">in_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">in</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">IN</span> <span class="pre">other</span></tt>.
“other” may be a tuple/list of column expressions,
or a <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> construct.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.is_">
<tt class="descname">is_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.is_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.is_" title="sqlalchemy.sql.operators.ColumnOperators.is_"><tt class="xref py py-meth docutils literal"><span class="pre">is_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">IS</span></tt> operator.</p>
<p>Normally, <tt class="docutils literal"><span class="pre">IS</span></tt> is generated automatically when comparing to a
value of <tt class="docutils literal"><span class="pre">None</span></tt>, which resolves to <tt class="docutils literal"><span class="pre">NULL</span></tt>. However, explicit
usage of <tt class="docutils literal"><span class="pre">IS</span></tt> may be desirable if comparing to boolean values
on certain platforms.</p>
<div class="versionadded">
<p><span>New in version 0.7.9.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.isnot" title="sqlalchemy.sql.operators.ColumnOperators.isnot"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.isnot()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.isnot">
<tt class="descname">isnot</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.isnot" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.isnot" title="sqlalchemy.sql.operators.ColumnOperators.isnot"><tt class="xref py py-meth docutils literal"><span class="pre">isnot()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> operator.</p>
<p>Normally, <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> is generated automatically when comparing to a
value of <tt class="docutils literal"><span class="pre">None</span></tt>, which resolves to <tt class="docutils literal"><span class="pre">NULL</span></tt>. However, explicit
usage of <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> may be desirable if comparing to boolean values
on certain platforms.</p>
<div class="versionadded">
<p><span>New in version 0.7.9.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.is_" title="sqlalchemy.sql.operators.ColumnOperators.is_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.is_()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.like">
<tt class="descname">like</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.like" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">like()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">like</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">LIKE</span> <span class="pre">other</span></tt>.</p>
<p>E.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">sometable</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">sometable</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">column</span><span class="o">.</span><span class="n">like</span><span class="p">(</span><span class="s">"</span><span class="si">%f</span><span class="s">oobar%"</span><span class="p">))</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.like.params.other"></span><strong>other</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.like.params.other">¶</a> – expression to be compared</li>
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.like.params.escape"></span><strong>escape</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.like.params.escape">¶</a> – <p>optional escape character, renders the <tt class="docutils literal"><span class="pre">ESCAPE</span></tt>
keyword, e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">like</span><span class="p">(</span><span class="s">"foo/%bar"</span><span class="p">,</span> <span class="n">escape</span><span class="o">=</span><span class="s">"/"</span><span class="p">)</span></pre></div>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.match">
<tt class="descname">match</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.match" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.match" title="sqlalchemy.sql.operators.ColumnOperators.match"><tt class="xref py py-meth docutils literal"><span class="pre">match()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implements a database-specific ‘match’ operator.</p>
<p><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.match" title="sqlalchemy.sql.operators.ColumnOperators.match"><tt class="xref py py-meth docutils literal"><span class="pre">match()</span></tt></a> attempts to resolve to
a MATCH-like function or operator provided by the backend.
Examples include:</p>
<ul class="simple">
<li>Postgresql - renders <tt class="docutils literal"><span class="pre">x</span> <span class="pre">@@</span> <span class="pre">to_tsquery(y)</span></tt></li>
<li>MySQL - renders <tt class="docutils literal"><span class="pre">MATCH</span> <span class="pre">(x)</span> <span class="pre">AGAINST</span> <span class="pre">(y</span> <span class="pre">IN</span> <span class="pre">BOOLEAN</span> <span class="pre">MODE)</span></tt></li>
<li>Oracle - renders <tt class="docutils literal"><span class="pre">CONTAINS(x,</span> <span class="pre">y)</span></tt></li>
<li>other backends may provide special implementations;
some backends such as SQLite have no support.</li>
</ul>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.notilike">
<tt class="descname">notilike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.notilike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notilike" title="sqlalchemy.sql.operators.ColumnOperators.notilike"><tt class="xref py py-meth docutils literal"><span class="pre">notilike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">ILIKE</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.ilike(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.notin_">
<tt class="descname">notin_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.notin_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notin_" title="sqlalchemy.sql.operators.ColumnOperators.notin_"><tt class="xref py py-meth docutils literal"><span class="pre">notin_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">IN</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.in_()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.in_(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.in_()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.notlike">
<tt class="descname">notlike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.notlike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notlike" title="sqlalchemy.sql.operators.ColumnOperators.notlike"><tt class="xref py py-meth docutils literal"><span class="pre">notlike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">LIKE</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.like(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.nullsfirst">
<tt class="descname">nullsfirst</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.nullsfirst" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.nullsfirst" title="sqlalchemy.sql.operators.ColumnOperators.nullsfirst"><tt class="xref py py-meth docutils literal"><span class="pre">nullsfirst()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.nullsfirst" title="sqlalchemy.sql.expression.nullsfirst"><tt class="xref py py-func docutils literal"><span class="pre">nullsfirst()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.nullslast">
<tt class="descname">nullslast</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.nullslast" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.nullslast" title="sqlalchemy.sql.operators.ColumnOperators.nullslast"><tt class="xref py py-meth docutils literal"><span class="pre">nullslast()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.nullslast" title="sqlalchemy.sql.expression.nullslast"><tt class="xref py py-func docutils literal"><span class="pre">nullslast()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.of_type">
<tt class="descname">of_type</tt><big>(</big><em>class_</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.of_type" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.of_type" title="sqlalchemy.orm.interfaces.PropComparator.of_type"><tt class="xref py py-meth docutils literal"><span class="pre">of_type()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></div>
<p>Redefine this object in terms of a polymorphic subclass.</p>
<p>Returns a new PropComparator from which further criterion can be
evaluated.</p>
<p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">query</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">Company</span><span class="o">.</span><span class="n">employees</span><span class="o">.</span><span class="n">of_type</span><span class="p">(</span><span class="n">Engineer</span><span class="p">))</span><span class="o">.</span>\
<span class="nb">filter</span><span class="p">(</span><span class="n">Engineer</span><span class="o">.</span><span class="n">name</span><span class="o">==</span><span class="s">'foo'</span><span class="p">)</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.of_type.params.class_"></span><strong>class_</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.of_type.params.class_">¶</a> – a class or mapper indicating that criterion will be
against this specific subclass.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.op">
<tt class="descname">op</tt><big>(</big><em>opstring</em>, <em>precedence=0</em>, <em>is_comparison=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.op" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.op" title="sqlalchemy.sql.operators.Operators.op"><tt class="xref py py-meth docutils literal"><span class="pre">op()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators" title="sqlalchemy.sql.operators.Operators"><tt class="xref py py-class docutils literal"><span class="pre">Operators</span></tt></a></div>
<p>produce a generic operator function.</p>
<p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="s">"*"</span><span class="p">)(</span><span class="mi">5</span><span class="p">)</span></pre></div>
</div>
<p>produces:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span> <span class="o">*</span> <span class="mi">5</span></pre></div>
</div>
<p>This function can also be used to make bitwise operators explicit. For
example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="s">'&'</span><span class="p">)(</span><span class="mh">0xff</span><span class="p">)</span></pre></div>
</div>
<p>is a bitwise AND of the value in <tt class="docutils literal"><span class="pre">somecolumn</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.op.params.operator"></span><strong>operator</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.op.params.operator">¶</a> – a string which will be output as the infix operator
between this element and the expression passed to the
generated function.</li>
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.op.params.precedence"></span><strong>precedence</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.op.params.precedence">¶</a> – <p>precedence to apply to the operator, when
parenthesizing expressions. A lower number will cause the expression
to be parenthesized when applied against another operator with
higher precedence. The default value of <tt class="docutils literal"><span class="pre">0</span></tt> is lower than all
operators except for the comma (<tt class="docutils literal"><span class="pre">,</span></tt>) and <tt class="docutils literal"><span class="pre">AS</span></tt> operators.
A value of 100 will be higher or equal to all operators, and -100
will be lower than or equal to all operators.</p>
<div class="versionadded">
<p><span>New in version 0.8: </span>- added the ‘precedence’ argument.</p>
</div>
</li>
<li><span class="target" id="sqlalchemy.orm.properties.ColumnProperty.Comparator.op.params.is_comparison"></span><strong>is_comparison</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.op.params.is_comparison">¶</a> – <p>if True, the operator will be considered as a
“comparison” operator, that is which evaulates to a boolean
true/false value, like <tt class="docutils literal"><span class="pre">==</span></tt>, <tt class="docutils literal"><span class="pre">></span></tt>, etc. This flag should be set
so that ORM relationships can establish that the operator is a
comparison operator when used in a custom join condition.</p>
<div class="versionadded">
<p><span>New in version 0.9.2: </span>- added the
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.op.params.is_comparison" title="sqlalchemy.sql.operators.Operators.op"><tt class="xref py py-paramref docutils literal"><span class="pre">Operators.op.is_comparison</span></tt></a> flag.</p>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="../core/types.html#types-operators"><em>Redefining and Creating New Operators</em></a></p>
<p class="last"><a class="reference internal" href="relationships.html#relationship-custom-operator"><em>Using custom operators in join conditions</em></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.Comparator.startswith">
<tt class="descname">startswith</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator.startswith" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.startswith" title="sqlalchemy.sql.operators.ColumnOperators.startswith"><tt class="xref py py-meth docutils literal"><span class="pre">startswith()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">startwith</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'<other>%'</span></tt></p>
</dd></dl>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.__init__">
<tt class="descclassname">ColumnProperty.</tt><tt class="descname">__init__</tt><big>(</big><em>*columns</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new <a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty" title="sqlalchemy.orm.properties.ColumnProperty"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty</span></tt></a> object.</p>
<p>This constructor is mirrored as a public API function; see <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><tt class="xref py py-func docutils literal"><span class="pre">column_property()</span></tt></a> for a full usage and argument description.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.cascade_iterator">
<tt class="descclassname">ColumnProperty.</tt><tt class="descname">cascade_iterator</tt><big>(</big><em>type_</em>, <em>state</em>, <em>visited_instances=None</em>, <em>halt_on=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.cascade_iterator" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.cascade_iterator" title="sqlalchemy.orm.interfaces.MapperProperty.cascade_iterator"><tt class="xref py py-meth docutils literal"><span class="pre">cascade_iterator()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Iterate through instances related to the given instance for
a particular ‘cascade’, starting with this MapperProperty.</p>
<p>Return an iterator3-tuples (instance, mapper, state).</p>
<p>Note that the ‘cascade’ collection on this MapperProperty is
checked first for the given type before cascade_iterator is called.</p>
<p>See PropertyLoader for the related instance implementation.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.ColumnProperty.class_attribute">
<tt class="descclassname">ColumnProperty.</tt><tt class="descname">class_attribute</tt><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.class_attribute" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.class_attribute" title="sqlalchemy.orm.interfaces.MapperProperty.class_attribute"><tt class="xref py py-attr docutils literal"><span class="pre">class_attribute</span></tt></a> <em>attribute of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Return the class-bound descriptor corresponding to this
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>.</p>
<p>This is basically a <tt class="docutils literal"><span class="pre">getattr()</span></tt> call:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">class_</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span></pre></div>
</div>
<p>I.e. if this <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> were named <tt class="docutils literal"><span class="pre">addresses</span></tt>,
and the class to which it is mapped is <tt class="docutils literal"><span class="pre">User</span></tt>, this sequence
is possible:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">inspect</span>
<span class="gp">>>> </span><span class="n">mapper</span> <span class="o">=</span> <span class="n">inspect</span><span class="p">(</span><span class="n">User</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">addresses_property</span> <span class="o">=</span> <span class="n">mapper</span><span class="o">.</span><span class="n">attrs</span><span class="o">.</span><span class="n">addresses</span>
<span class="gp">>>> </span><span class="n">addresses_property</span><span class="o">.</span><span class="n">class_attribute</span> <span class="ow">is</span> <span class="n">User</span><span class="o">.</span><span class="n">addresses</span>
<span class="go">True</span>
<span class="gp">>>> </span><span class="n">User</span><span class="o">.</span><span class="n">addresses</span><span class="o">.</span><span class="n">property</span> <span class="ow">is</span> <span class="n">addresses_property</span>
<span class="go">True</span></pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.compare">
<tt class="descclassname">ColumnProperty.</tt><tt class="descname">compare</tt><big>(</big><em>operator</em>, <em>value</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.compare" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.compare" title="sqlalchemy.orm.interfaces.MapperProperty.compare"><tt class="xref py py-meth docutils literal"><span class="pre">compare()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Return a compare operation for the columns represented by
this <tt class="docutils literal"><span class="pre">MapperProperty</span></tt> to the given value, which may be a
column value or an instance. ‘operator’ is an operator from
the operators module, or from sql.Comparator.</p>
<p>By default uses the PropComparator attached to this MapperProperty
under the attribute name “comparator”.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.ColumnProperty.expression">
<tt class="descclassname">ColumnProperty.</tt><tt class="descname">expression</tt><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.expression" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the primary column or expression for this ColumnProperty.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.ColumnProperty.extension_type">
<tt class="descclassname">ColumnProperty.</tt><tt class="descname">extension_type</tt><em class="property"> = symbol('NOT_EXTENSION')</em><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.extension_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.ColumnProperty.info">
<tt class="descclassname">ColumnProperty.</tt><tt class="descname">info</tt><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.info" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.info" title="sqlalchemy.orm.interfaces.MapperProperty.info"><tt class="xref py py-attr docutils literal"><span class="pre">info</span></tt></a> <em>attribute of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Info dictionary associated with the object, allowing user-defined
data to be associated with this <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>.</p>
<p>The dictionary is generated when first accessed. Alternatively,
it can be specified as a constructor argument to the
<a class="reference internal" href="mapper_config.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><tt class="xref py py-func docutils literal"><span class="pre">column_property()</span></tt></a>, <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>, or <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.composite" title="sqlalchemy.orm.composite"><tt class="xref py py-func docutils literal"><span class="pre">composite()</span></tt></a>
functions.</p>
<div class="versionadded">
<p><span>New in version 0.8: </span>Added support for .info to all
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> subclasses.</p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.info" title="sqlalchemy.orm.attributes.QueryableAttribute.info"><tt class="xref py py-attr docutils literal"><span class="pre">QueryableAttribute.info</span></tt></a></p>
<p class="last"><a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.SchemaItem.info" title="sqlalchemy.schema.SchemaItem.info"><tt class="xref py py-attr docutils literal"><span class="pre">SchemaItem.info</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.init">
<tt class="descclassname">ColumnProperty.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.init" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.init" title="sqlalchemy.orm.interfaces.MapperProperty.init"><tt class="xref py py-meth docutils literal"><span class="pre">init()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Called after all mappers are created to assemble
relationships between mappers and perform other post-mapper-creation
initialization steps.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.ColumnProperty.is_primary">
<tt class="descclassname">ColumnProperty.</tt><tt class="descname">is_primary</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.ColumnProperty.is_primary" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.is_primary" title="sqlalchemy.orm.interfaces.MapperProperty.is_primary"><tt class="xref py py-meth docutils literal"><span class="pre">is_primary()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Return True if this <tt class="docutils literal"><span class="pre">MapperProperty</span></tt>‘s mapper is the
primary mapper for its class.</p>
<p>This flag is used to indicate that the <tt class="docutils literal"><span class="pre">MapperProperty</span></tt> can
define attribute instrumentation for the class at the class
level (as opposed to the individual instance level).</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.descriptor_props.CompositeProperty">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.descriptor_props.</tt><tt class="descname">CompositeProperty</tt><big>(</big><em>class_</em>, <em>*attrs</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.CompositeProperty" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.descriptor_props.DescriptorProperty</span></tt></p>
<p>Defines a “composite” mapped attribute, representing a collection
of columns as one attribute.</p>
<p><a class="reference internal" href="#sqlalchemy.orm.descriptor_props.CompositeProperty" title="sqlalchemy.orm.descriptor_props.CompositeProperty"><tt class="xref py py-class docutils literal"><span class="pre">CompositeProperty</span></tt></a> is constructed using the <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.composite" title="sqlalchemy.orm.composite"><tt class="xref py py-func docutils literal"><span class="pre">composite()</span></tt></a>
function.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="mapper_config.html#mapper-composite"><em>Composite Column Types</em></a></p>
</div>
<dl class="class">
<dt id="sqlalchemy.orm.descriptor_props.CompositeProperty.Comparator">
<em class="property">class </em><tt class="descname">Comparator</tt><big>(</big><em>prop</em>, <em>parentmapper</em>, <em>adapt_to_entity=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.CompositeProperty.Comparator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.interfaces.PropComparator</span></tt></a></p>
<p>Produce boolean, comparison, and other operators for
<a class="reference internal" href="#sqlalchemy.orm.descriptor_props.CompositeProperty" title="sqlalchemy.orm.descriptor_props.CompositeProperty"><tt class="xref py py-class docutils literal"><span class="pre">CompositeProperty</span></tt></a> attributes.</p>
<p>See the example in <a class="reference internal" href="mapper_config.html#composite-operations"><em>Redefining Comparison Operations for Composites</em></a> for an overview
of usage , as well as the documentation for <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a>.</p>
<p>See also:</p>
<p><a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></p>
<p><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></p>
<p><a class="reference internal" href="../core/types.html#types-operators"><em>Redefining and Creating New Operators</em></a></p>
<p><a class="reference internal" href="../core/types.html#sqlalchemy.types.TypeEngine.comparator_factory" title="sqlalchemy.types.TypeEngine.comparator_factory"><tt class="xref py py-attr docutils literal"><span class="pre">TypeEngine.comparator_factory</span></tt></a></p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.CompositeProperty.__init__">
<tt class="descclassname">CompositeProperty.</tt><tt class="descname">__init__</tt><big>(</big><em>class_</em>, <em>*attrs</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.CompositeProperty.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new <a class="reference internal" href="#sqlalchemy.orm.descriptor_props.CompositeProperty" title="sqlalchemy.orm.descriptor_props.CompositeProperty"><tt class="xref py py-class docutils literal"><span class="pre">CompositeProperty</span></tt></a> object.</p>
<p>This constructor is mirrored as a public API function; see <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.composite" title="sqlalchemy.orm.composite"><tt class="xref py py-func docutils literal"><span class="pre">composite()</span></tt></a> for a full usage and argument description.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.CompositeProperty.do_init">
<tt class="descclassname">CompositeProperty.</tt><tt class="descname">do_init</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.CompositeProperty.do_init" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialization which occurs after the <a class="reference internal" href="#sqlalchemy.orm.descriptor_props.CompositeProperty" title="sqlalchemy.orm.descriptor_props.CompositeProperty"><tt class="xref py py-class docutils literal"><span class="pre">CompositeProperty</span></tt></a>
has been associated with its parent mapper.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.CompositeProperty.get_history">
<tt class="descclassname">CompositeProperty.</tt><tt class="descname">get_history</tt><big>(</big><em>state</em>, <em>dict_</em>, <em>passive=symbol('PASSIVE_OFF')</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.CompositeProperty.get_history" title="Permalink to this definition">¶</a></dt>
<dd><p>Provided for userland code that uses attributes.get_history().</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.attributes.Event">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.attributes.</tt><tt class="descname">Event</tt><big>(</big><em>attribute_impl</em>, <em>op</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.Event" title="Permalink to this definition">¶</a></dt>
<dd><p>A token propagated throughout the course of a chain of attribute
events.</p>
<p>Serves as an indicator of the source of the event and also provides
a means of controlling propagation across a chain of attribute
operations.</p>
<p>The <a class="reference internal" href="#sqlalchemy.orm.attributes.Event" title="sqlalchemy.orm.attributes.Event"><tt class="xref py py-class docutils literal"><span class="pre">Event</span></tt></a> object is sent as the <tt class="docutils literal"><span class="pre">initiator</span></tt> argument
when dealing with the <a class="reference internal" href="events.html#sqlalchemy.orm.events.AttributeEvents.append" title="sqlalchemy.orm.events.AttributeEvents.append"><tt class="xref py py-meth docutils literal"><span class="pre">AttributeEvents.append()</span></tt></a>,
<a class="reference internal" href="events.html#sqlalchemy.orm.events.AttributeEvents.set" title="sqlalchemy.orm.events.AttributeEvents.set"><tt class="xref py py-meth docutils literal"><span class="pre">AttributeEvents.set()</span></tt></a>,
and <a class="reference internal" href="events.html#sqlalchemy.orm.events.AttributeEvents.remove" title="sqlalchemy.orm.events.AttributeEvents.remove"><tt class="xref py py-meth docutils literal"><span class="pre">AttributeEvents.remove()</span></tt></a> events.</p>
<p>The <a class="reference internal" href="#sqlalchemy.orm.attributes.Event" title="sqlalchemy.orm.attributes.Event"><tt class="xref py py-class docutils literal"><span class="pre">Event</span></tt></a> object is currently interpreted by the backref
event handlers, and is used to control the propagation of operations
across two mutually-dependent attributes.</p>
<div class="versionadded">
<p><span>New in version 0.9.0.</span></p>
</div>
<dl class="attribute">
<dt id="sqlalchemy.orm.attributes.Event.impl">
<tt class="descname">impl</tt><em class="property"> = None</em><a class="headerlink" href="#sqlalchemy.orm.attributes.Event.impl" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="xref py py-class docutils literal"><span class="pre">AttributeImpl</span></tt> which is the current event initiator.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.attributes.Event.op">
<tt class="descname">op</tt><em class="property"> = None</em><a class="headerlink" href="#sqlalchemy.orm.attributes.Event.op" title="Permalink to this definition">¶</a></dt>
<dd><p>The symbol <tt class="xref py py-attr docutils literal"><span class="pre">OP_APPEND</span></tt>, <tt class="xref py py-attr docutils literal"><span class="pre">OP_REMOVE</span></tt> or <tt class="xref py py-attr docutils literal"><span class="pre">OP_REPLACE</span></tt>,
indicating the source operation.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.interfaces._InspectionAttr">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.interfaces.</tt><tt class="descname">_InspectionAttr</tt><a class="headerlink" href="#sqlalchemy.orm.interfaces._InspectionAttr" title="Permalink to this definition">¶</a></dt>
<dd><p>A base class applied to all ORM objects that can be returned
by the <a class="reference internal" href="../core/inspection.html#sqlalchemy.inspection.inspect" title="sqlalchemy.inspection.inspect"><tt class="xref py py-func docutils literal"><span class="pre">inspect()</span></tt></a> function.</p>
<p>The attributes defined here allow the usage of simple boolean
checks to test basic facts about the object returned.</p>
<p>While the boolean checks here are basically the same as using
the Python isinstance() function, the flags here can be used without
the need to import all of these classes, and also such that
the SQLAlchemy class system can change while leaving the flags
here intact for forwards-compatibility.</p>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces._InspectionAttr.extension_type">
<tt class="descname">extension_type</tt><em class="property"> = symbol('NOT_EXTENSION')</em><a class="headerlink" href="#sqlalchemy.orm.interfaces._InspectionAttr.extension_type" title="Permalink to this definition">¶</a></dt>
<dd><p>The extension type, if any.
Defaults to <a class="reference internal" href="#sqlalchemy.orm.interfaces.NOT_EXTENSION" title="sqlalchemy.orm.interfaces.NOT_EXTENSION"><tt class="xref py py-data docutils literal"><span class="pre">interfaces.NOT_EXTENSION</span></tt></a></p>
<div class="versionadded">
<p><span>New in version 0.8.0.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="extensions/hybrid.html#sqlalchemy.ext.hybrid.HYBRID_METHOD" title="sqlalchemy.ext.hybrid.HYBRID_METHOD"><tt class="xref py py-data docutils literal"><span class="pre">HYBRID_METHOD</span></tt></a></p>
<p><a class="reference internal" href="extensions/hybrid.html#sqlalchemy.ext.hybrid.HYBRID_PROPERTY" title="sqlalchemy.ext.hybrid.HYBRID_PROPERTY"><tt class="xref py py-data docutils literal"><span class="pre">HYBRID_PROPERTY</span></tt></a></p>
<p class="last"><a class="reference internal" href="extensions/associationproxy.html#sqlalchemy.ext.associationproxy.ASSOCIATION_PROXY" title="sqlalchemy.ext.associationproxy.ASSOCIATION_PROXY"><tt class="xref py py-data docutils literal"><span class="pre">ASSOCIATION_PROXY</span></tt></a></p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces._InspectionAttr.is_aliased_class">
<tt class="descname">is_aliased_class</tt><em class="property"> = False</em><a class="headerlink" href="#sqlalchemy.orm.interfaces._InspectionAttr.is_aliased_class" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this object is an instance of <a class="reference internal" href="query.html#sqlalchemy.orm.util.AliasedClass" title="sqlalchemy.orm.util.AliasedClass"><tt class="xref py py-class docutils literal"><span class="pre">AliasedClass</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces._InspectionAttr.is_attribute">
<tt class="descname">is_attribute</tt><em class="property"> = False</em><a class="headerlink" href="#sqlalchemy.orm.interfaces._InspectionAttr.is_attribute" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this object is a Python <a class="reference internal" href="../glossary.html#term-descriptor"><em class="xref std std-term">descriptor</em></a>.</p>
<p>This can refer to one of many types. Usually a
<a class="reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute" title="sqlalchemy.orm.attributes.QueryableAttribute"><tt class="xref py py-class docutils literal"><span class="pre">QueryableAttribute</span></tt></a> which handles attributes events on behalf
of a <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>. But can also be an extension type
such as <a class="reference internal" href="extensions/associationproxy.html#sqlalchemy.ext.associationproxy.AssociationProxy" title="sqlalchemy.ext.associationproxy.AssociationProxy"><tt class="xref py py-class docutils literal"><span class="pre">AssociationProxy</span></tt></a> or <a class="reference internal" href="extensions/hybrid.html#sqlalchemy.ext.hybrid.hybrid_property" title="sqlalchemy.ext.hybrid.hybrid_property"><tt class="xref py py-class docutils literal"><span class="pre">hybrid_property</span></tt></a>.
The <a class="reference internal" href="#sqlalchemy.orm.interfaces._InspectionAttr.extension_type" title="sqlalchemy.orm.interfaces._InspectionAttr.extension_type"><tt class="xref py py-attr docutils literal"><span class="pre">_InspectionAttr.extension_type</span></tt></a> will refer to a constant
identifying the specific subtype.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="mapper_config.html#sqlalchemy.orm.mapper.Mapper.all_orm_descriptors" title="sqlalchemy.orm.mapper.Mapper.all_orm_descriptors"><tt class="xref py py-attr docutils literal"><span class="pre">Mapper.all_orm_descriptors</span></tt></a></p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces._InspectionAttr.is_clause_element">
<tt class="descname">is_clause_element</tt><em class="property"> = False</em><a class="headerlink" href="#sqlalchemy.orm.interfaces._InspectionAttr.is_clause_element" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this object is an instance of <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces._InspectionAttr.is_instance">
<tt class="descname">is_instance</tt><em class="property"> = False</em><a class="headerlink" href="#sqlalchemy.orm.interfaces._InspectionAttr.is_instance" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this object is an instance of <a class="reference internal" href="#sqlalchemy.orm.state.InstanceState" title="sqlalchemy.orm.state.InstanceState"><tt class="xref py py-class docutils literal"><span class="pre">InstanceState</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces._InspectionAttr.is_mapper">
<tt class="descname">is_mapper</tt><em class="property"> = False</em><a class="headerlink" href="#sqlalchemy.orm.interfaces._InspectionAttr.is_mapper" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this object is an instance of <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.mapper.Mapper" title="sqlalchemy.orm.mapper.Mapper"><tt class="xref py py-class docutils literal"><span class="pre">Mapper</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces._InspectionAttr.is_property">
<tt class="descname">is_property</tt><em class="property"> = False</em><a class="headerlink" href="#sqlalchemy.orm.interfaces._InspectionAttr.is_property" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this object is an instance of <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces._InspectionAttr.is_selectable">
<tt class="descname">is_selectable</tt><em class="property"> = False</em><a class="headerlink" href="#sqlalchemy.orm.interfaces._InspectionAttr.is_selectable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if this object is an instance of <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.Selectable" title="sqlalchemy.sql.expression.Selectable"><tt class="xref py py-class docutils literal"><span class="pre">Selectable</span></tt></a>.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.state.InstanceState">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.state.</tt><tt class="descname">InstanceState</tt><big>(</big><em>obj</em>, <em>manager</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.base._InspectionAttr</span></tt></p>
<p>tracks state information at the instance level.</p>
<p>The <a class="reference internal" href="#sqlalchemy.orm.state.InstanceState" title="sqlalchemy.orm.state.InstanceState"><tt class="xref py py-class docutils literal"><span class="pre">InstanceState</span></tt></a> is a key object used by the
SQLAlchemy ORM in order to track the state of an object;
it is created the moment an object is instantiated, typically
as a result of <a class="reference internal" href="../glossary.html#term-instrumentation"><em class="xref std std-term">instrumentation</em></a> which SQLAlchemy applies
to the <tt class="docutils literal"><span class="pre">__init__()</span></tt> method of the class.</p>
<p><a class="reference internal" href="#sqlalchemy.orm.state.InstanceState" title="sqlalchemy.orm.state.InstanceState"><tt class="xref py py-class docutils literal"><span class="pre">InstanceState</span></tt></a> is also a semi-public object,
available for runtime inspection as to the state of a
mapped instance, including information such as its current
status within a particular <a class="reference internal" href="session.html#sqlalchemy.orm.session.Session" title="sqlalchemy.orm.session.Session"><tt class="xref py py-class docutils literal"><span class="pre">Session</span></tt></a> and details
about data on individual attributes. The public API
in order to acquire a <a class="reference internal" href="#sqlalchemy.orm.state.InstanceState" title="sqlalchemy.orm.state.InstanceState"><tt class="xref py py-class docutils literal"><span class="pre">InstanceState</span></tt></a> object
is to use the <a class="reference internal" href="../core/inspection.html#sqlalchemy.inspection.inspect" title="sqlalchemy.inspection.inspect"><tt class="xref py py-func docutils literal"><span class="pre">inspect()</span></tt></a> system:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">inspect</span>
<span class="gp">>>> </span><span class="n">insp</span> <span class="o">=</span> <span class="n">inspect</span><span class="p">(</span><span class="n">some_mapped_object</span><span class="p">)</span></pre></div>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/inspection.html"><em>Runtime Inspection API</em></a></p>
</div>
<dl class="method">
<dt id="sqlalchemy.orm.state.InstanceState.__call__">
<tt class="descname">__call__</tt><big>(</big><em>state</em>, <em>passive</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.__call__" title="Permalink to this definition">¶</a></dt>
<dd><p>__call__ allows the InstanceState to act as a deferred
callable for loading expired attributes, which is also
serializable (picklable).</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.attrs">
<tt class="descname">attrs</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.attrs" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a namespace representing each attribute on
the mapped object, including its current value
and history.</p>
<p>The returned object is an instance of <a class="reference internal" href="#sqlalchemy.orm.state.AttributeState" title="sqlalchemy.orm.state.AttributeState"><tt class="xref py py-class docutils literal"><span class="pre">AttributeState</span></tt></a>.
This object allows inspection of the current data
within an attribute as well as attribute history
since the last flush.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.detached">
<tt class="descname">detached</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.detached" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if the object is <a class="reference internal" href="../glossary.html#term-detached"><em class="xref std std-term">detached</em></a>.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="session.html#session-object-states"><em>Quickie Intro to Object States</em></a></p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.dict">
<tt class="descname">dict</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the instance dict used by the object.</p>
<p>Under normal circumstances, this is always synonymous
with the <tt class="docutils literal"><span class="pre">__dict__</span></tt> attribute of the mapped object,
unless an alternative instrumentation system has been
configured.</p>
<p>In the case that the actual object has been garbage
collected, this accessor returns a blank dictionary.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.expired_attributes">
<tt class="descname">expired_attributes</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.expired_attributes" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the set of keys which are ‘expired’ to be loaded by
the manager’s deferred scalar loader, assuming no pending
changes.</p>
<p>see also the <tt class="docutils literal"><span class="pre">unmodified</span></tt> collection which is intersected
against this set when a refresh operation occurs.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.has_identity">
<tt class="descname">has_identity</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.has_identity" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <tt class="docutils literal"><span class="pre">True</span></tt> if this object has an identity key.</p>
<p>This should always have the same value as the
expression <tt class="docutils literal"><span class="pre">state.persistent</span> <span class="pre">or</span> <span class="pre">state.detached</span></tt>.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.identity">
<tt class="descname">identity</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.identity" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the mapped identity of the mapped object.
This is the primary key identity as persisted by the ORM
which can always be passed directly to
<a class="reference internal" href="query.html#sqlalchemy.orm.query.Query.get" title="sqlalchemy.orm.query.Query.get"><tt class="xref py py-meth docutils literal"><span class="pre">Query.get()</span></tt></a>.</p>
<p>Returns <tt class="docutils literal"><span class="pre">None</span></tt> if the object has no primary key identity.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">An object which is transient or pending
does <strong>not</strong> have a mapped identity until it is flushed,
even if its attributes include primary key values.</p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.identity_key">
<tt class="descname">identity_key</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.identity_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the identity key for the mapped object.</p>
<p>This is the key used to locate the object within
the <a class="reference internal" href="session.html#sqlalchemy.orm.session.Session.identity_map" title="sqlalchemy.orm.session.Session.identity_map"><tt class="xref py py-attr docutils literal"><span class="pre">Session.identity_map</span></tt></a> mapping. It contains
the identity as returned by <a class="reference internal" href="#sqlalchemy.orm.state.InstanceState.identity" title="sqlalchemy.orm.state.InstanceState.identity"><tt class="xref py py-attr docutils literal"><span class="pre">identity</span></tt></a> within it.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.mapper">
<tt class="descname">mapper</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.mapper" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.mapper.Mapper" title="sqlalchemy.orm.mapper.Mapper"><tt class="xref py py-class docutils literal"><span class="pre">Mapper</span></tt></a> used for this mapepd object.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.object">
<tt class="descname">object</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.object" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the mapped object represented by this
<a class="reference internal" href="#sqlalchemy.orm.state.InstanceState" title="sqlalchemy.orm.state.InstanceState"><tt class="xref py py-class docutils literal"><span class="pre">InstanceState</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.pending">
<tt class="descname">pending</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.pending" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if the object is <a class="reference internal" href="../glossary.html#term-pending"><em class="xref std std-term">pending</em></a>.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="session.html#session-object-states"><em>Quickie Intro to Object States</em></a></p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.persistent">
<tt class="descname">persistent</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.persistent" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if the object is <a class="reference internal" href="../glossary.html#term-persistent"><em class="xref std std-term">persistent</em></a>.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="session.html#session-object-states"><em>Quickie Intro to Object States</em></a></p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.session">
<tt class="descname">session</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.session" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the owning <a class="reference internal" href="session.html#sqlalchemy.orm.session.Session" title="sqlalchemy.orm.session.Session"><tt class="xref py py-class docutils literal"><span class="pre">Session</span></tt></a> for this instance,
or <tt class="docutils literal"><span class="pre">None</span></tt> if none available.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.transient">
<tt class="descname">transient</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.transient" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if the object is <a class="reference internal" href="../glossary.html#term-transient"><em class="xref std std-term">transient</em></a>.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="session.html#session-object-states"><em>Quickie Intro to Object States</em></a></p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.unloaded">
<tt class="descname">unloaded</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.unloaded" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the set of keys which do not have a loaded value.</p>
<p>This includes expired attributes and any other attribute that
was never populated or modified.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.state.InstanceState.unmodified">
<tt class="descname">unmodified</tt><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.unmodified" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the set of keys which have no uncommitted changes</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.state.InstanceState.unmodified_intersection">
<tt class="descname">unmodified_intersection</tt><big>(</big><em>keys</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.state.InstanceState.unmodified_intersection" title="Permalink to this definition">¶</a></dt>
<dd><p>Return self.unmodified.intersection(keys).</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.attributes.InstrumentedAttribute">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.attributes.</tt><tt class="descname">InstrumentedAttribute</tt><big>(</big><em>class_</em>, <em>key</em>, <em>impl=None</em>, <em>comparator=None</em>, <em>parententity=None</em>, <em>of_type=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.InstrumentedAttribute" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute" title="sqlalchemy.orm.attributes.QueryableAttribute"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.attributes.QueryableAttribute</span></tt></a></p>
<p>Class bound instrumented attribute which adds basic
<a class="reference internal" href="../glossary.html#term-descriptor"><em class="xref std std-term">descriptor</em></a> methods.</p>
<p>See <a class="reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute" title="sqlalchemy.orm.attributes.QueryableAttribute"><tt class="xref py py-class docutils literal"><span class="pre">QueryableAttribute</span></tt></a> for a description of most features.</p>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.InstrumentedAttribute.__delete__">
<tt class="descname">__delete__</tt><big>(</big><em>instance</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.InstrumentedAttribute.__delete__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.InstrumentedAttribute.__get__">
<tt class="descname">__get__</tt><big>(</big><em>instance</em>, <em>owner</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.InstrumentedAttribute.__get__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.InstrumentedAttribute.__set__">
<tt class="descname">__set__</tt><big>(</big><em>instance</em>, <em>value</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.InstrumentedAttribute.__set__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="data">
<dt id="sqlalchemy.orm.interfaces.MANYTOONE">
<tt class="descclassname">sqlalchemy.orm.interfaces.</tt><tt class="descname">MANYTOONE</tt><em class="property"> = symbol('MANYTOONE')</em><a class="headerlink" href="#sqlalchemy.orm.interfaces.MANYTOONE" title="Permalink to this definition">¶</a></dt>
<dd><p>Indicates the many-to-one direction for a <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>.</p>
<p>This symbol is typically used by the internals but may be exposed within
certain API features.</p>
</dd></dl>
<dl class="data">
<dt id="sqlalchemy.orm.interfaces.MANYTOMANY">
<tt class="descclassname">sqlalchemy.orm.interfaces.</tt><tt class="descname">MANYTOMANY</tt><em class="property"> = symbol('MANYTOMANY')</em><a class="headerlink" href="#sqlalchemy.orm.interfaces.MANYTOMANY" title="Permalink to this definition">¶</a></dt>
<dd><p>Indicates the many-to-many direction for a <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>.</p>
<p>This symbol is typically used by the internals but may be exposed within
certain API features.</p>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.interfaces.MapperProperty">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.interfaces.</tt><tt class="descname">MapperProperty</tt><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.base._MappedAttribute</span></tt>, <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.base._InspectionAttr</span></tt></p>
<p>Manage the relationship of a <tt class="docutils literal"><span class="pre">Mapper</span></tt> to a single class
attribute, as well as that attribute as it appears on individual
instances of the class, including attribute instrumentation,
attribute access, loading behavior, and dependency calculations.</p>
<p>The most common occurrences of <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> are the
mapped <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt></a>, which is represented in a mapping as
an instance of <a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty" title="sqlalchemy.orm.properties.ColumnProperty"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty</span></tt></a>,
and a reference to another class produced by <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>,
represented in the mapping as an instance of
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty" title="sqlalchemy.orm.properties.RelationshipProperty"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty</span></tt></a>.</p>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.cascade">
<tt class="descname">cascade</tt><em class="property"> = frozenset([])</em><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.cascade" title="Permalink to this definition">¶</a></dt>
<dd><p>The set of ‘cascade’ attribute names.</p>
<p>This collection is checked before the ‘cascade_iterator’ method is called.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.cascade_iterator">
<tt class="descname">cascade_iterator</tt><big>(</big><em>type_</em>, <em>state</em>, <em>visited_instances=None</em>, <em>halt_on=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.cascade_iterator" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterate through instances related to the given instance for
a particular ‘cascade’, starting with this MapperProperty.</p>
<p>Return an iterator3-tuples (instance, mapper, state).</p>
<p>Note that the ‘cascade’ collection on this MapperProperty is
checked first for the given type before cascade_iterator is called.</p>
<p>See PropertyLoader for the related instance implementation.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.class_attribute">
<tt class="descname">class_attribute</tt><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.class_attribute" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the class-bound descriptor corresponding to this
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>.</p>
<p>This is basically a <tt class="docutils literal"><span class="pre">getattr()</span></tt> call:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">class_</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span></pre></div>
</div>
<p>I.e. if this <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> were named <tt class="docutils literal"><span class="pre">addresses</span></tt>,
and the class to which it is mapped is <tt class="docutils literal"><span class="pre">User</span></tt>, this sequence
is possible:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">inspect</span>
<span class="gp">>>> </span><span class="n">mapper</span> <span class="o">=</span> <span class="n">inspect</span><span class="p">(</span><span class="n">User</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">addresses_property</span> <span class="o">=</span> <span class="n">mapper</span><span class="o">.</span><span class="n">attrs</span><span class="o">.</span><span class="n">addresses</span>
<span class="gp">>>> </span><span class="n">addresses_property</span><span class="o">.</span><span class="n">class_attribute</span> <span class="ow">is</span> <span class="n">User</span><span class="o">.</span><span class="n">addresses</span>
<span class="go">True</span>
<span class="gp">>>> </span><span class="n">User</span><span class="o">.</span><span class="n">addresses</span><span class="o">.</span><span class="n">property</span> <span class="ow">is</span> <span class="n">addresses_property</span>
<span class="go">True</span></pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.compare">
<tt class="descname">compare</tt><big>(</big><em>operator</em>, <em>value</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.compare" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a compare operation for the columns represented by
this <tt class="docutils literal"><span class="pre">MapperProperty</span></tt> to the given value, which may be a
column value or an instance. ‘operator’ is an operator from
the operators module, or from sql.Comparator.</p>
<p>By default uses the PropComparator attached to this MapperProperty
under the attribute name “comparator”.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.create_row_processor">
<tt class="descname">create_row_processor</tt><big>(</big><em>context</em>, <em>path</em>, <em>mapper</em>, <em>row</em>, <em>adapter</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.create_row_processor" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 3-tuple consisting of three row processing functions.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.do_init">
<tt class="descname">do_init</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.do_init" title="Permalink to this definition">¶</a></dt>
<dd><p>Perform subclass-specific initialization post-mapper-creation
steps.</p>
<p>This is a template method called by the <tt class="docutils literal"><span class="pre">MapperProperty</span></tt>
object’s init() method.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.info">
<tt class="descname">info</tt><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.info" title="Permalink to this definition">¶</a></dt>
<dd><p>Info dictionary associated with the object, allowing user-defined
data to be associated with this <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>.</p>
<p>The dictionary is generated when first accessed. Alternatively,
it can be specified as a constructor argument to the
<a class="reference internal" href="mapper_config.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><tt class="xref py py-func docutils literal"><span class="pre">column_property()</span></tt></a>, <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>, or <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.composite" title="sqlalchemy.orm.composite"><tt class="xref py py-func docutils literal"><span class="pre">composite()</span></tt></a>
functions.</p>
<div class="versionadded">
<p><span>New in version 0.8: </span>Added support for .info to all
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> subclasses.</p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.info" title="sqlalchemy.orm.attributes.QueryableAttribute.info"><tt class="xref py py-attr docutils literal"><span class="pre">QueryableAttribute.info</span></tt></a></p>
<p class="last"><a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.SchemaItem.info" title="sqlalchemy.schema.SchemaItem.info"><tt class="xref py py-attr docutils literal"><span class="pre">SchemaItem.info</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.init">
<tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.init" title="Permalink to this definition">¶</a></dt>
<dd><p>Called after all mappers are created to assemble
relationships between mappers and perform other post-mapper-creation
initialization steps.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.is_primary">
<tt class="descname">is_primary</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.is_primary" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if this <tt class="docutils literal"><span class="pre">MapperProperty</span></tt>‘s mapper is the
primary mapper for its class.</p>
<p>This flag is used to indicate that the <tt class="docutils literal"><span class="pre">MapperProperty</span></tt> can
define attribute instrumentation for the class at the class
level (as opposed to the individual instance level).</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.merge">
<tt class="descname">merge</tt><big>(</big><em>session</em>, <em>source_state</em>, <em>source_dict</em>, <em>dest_state</em>, <em>dest_dict</em>, <em>load</em>, <em>_recursive</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.merge" title="Permalink to this definition">¶</a></dt>
<dd><p>Merge the attribute represented by this <tt class="docutils literal"><span class="pre">MapperProperty</span></tt>
from source to destination object</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.post_instrument_class">
<tt class="descname">post_instrument_class</tt><big>(</big><em>mapper</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.post_instrument_class" title="Permalink to this definition">¶</a></dt>
<dd><p>Perform instrumentation adjustments that need to occur
after init() has completed.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.MapperProperty.setup">
<tt class="descname">setup</tt><big>(</big><em>context</em>, <em>entity</em>, <em>path</em>, <em>adapter</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.MapperProperty.setup" title="Permalink to this definition">¶</a></dt>
<dd><p>Called by Query for the purposes of constructing a SQL statement.</p>
<p>Each MapperProperty associated with the target mapper processes the
statement referenced by the query context, adding columns and/or
criterion as appropriate.</p>
</dd></dl>
</dd></dl>
<dl class="data">
<dt id="sqlalchemy.orm.interfaces.NOT_EXTENSION">
<tt class="descclassname">sqlalchemy.orm.interfaces.</tt><tt class="descname">NOT_EXTENSION</tt><em class="property"> = symbol('NOT_EXTENSION')</em><a class="headerlink" href="#sqlalchemy.orm.interfaces.NOT_EXTENSION" title="Permalink to this definition">¶</a></dt>
<dd><p>Symbol indicating an <tt class="xref py py-class docutils literal"><span class="pre">_InspectionAttr</span></tt> that’s
not part of sqlalchemy.ext.</p>
<p>Is assigned to the <a class="reference internal" href="#sqlalchemy.orm.interfaces._InspectionAttr.extension_type" title="sqlalchemy.orm.interfaces._InspectionAttr.extension_type"><tt class="xref py py-attr docutils literal"><span class="pre">_InspectionAttr.extension_type</span></tt></a>
attibute.</p>
</dd></dl>
<dl class="data">
<dt id="sqlalchemy.orm.interfaces.ONETOMANY">
<tt class="descclassname">sqlalchemy.orm.interfaces.</tt><tt class="descname">ONETOMANY</tt><em class="property"> = symbol('ONETOMANY')</em><a class="headerlink" href="#sqlalchemy.orm.interfaces.ONETOMANY" title="Permalink to this definition">¶</a></dt>
<dd><p>Indicates the one-to-many direction for a <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>.</p>
<p>This symbol is typically used by the internals but may be exposed within
certain API features.</p>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.interfaces.PropComparator">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.interfaces.</tt><tt class="descname">PropComparator</tt><big>(</big><em>prop</em>, <em>parentmapper</em>, <em>adapt_to_entity=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.operators.ColumnOperators</span></tt></a></p>
<p>Defines boolean, comparison, and other operators for
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> objects.</p>
<p>SQLAlchemy allows for operators to
be redefined at both the Core and ORM level. <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a>
is the base class of operator redefinition for ORM-level operations,
including those of <a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty" title="sqlalchemy.orm.properties.ColumnProperty"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty</span></tt></a>,
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty" title="sqlalchemy.orm.properties.RelationshipProperty"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty</span></tt></a>, and <a class="reference internal" href="#sqlalchemy.orm.descriptor_props.CompositeProperty" title="sqlalchemy.orm.descriptor_props.CompositeProperty"><tt class="xref py py-class docutils literal"><span class="pre">CompositeProperty</span></tt></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">With the advent of Hybrid properties introduced in SQLAlchemy
0.7, as well as Core-level operator redefinition in
SQLAlchemy 0.8, the use case for user-defined <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a>
instances is extremely rare. See <a class="reference internal" href="extensions/hybrid.html"><em>Hybrid Attributes</em></a> as well
as <a class="reference internal" href="../core/types.html#types-operators"><em>Redefining and Creating New Operators</em></a>.</p>
</div>
<p>User-defined subclasses of <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a> may be created. The
built-in Python comparison and math operator methods, such as
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__eq__" title="sqlalchemy.sql.operators.ColumnOperators.__eq__"><tt class="xref py py-meth docutils literal"><span class="pre">operators.ColumnOperators.__eq__()</span></tt></a>,
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__lt__" title="sqlalchemy.sql.operators.ColumnOperators.__lt__"><tt class="xref py py-meth docutils literal"><span class="pre">operators.ColumnOperators.__lt__()</span></tt></a>, and
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__add__" title="sqlalchemy.sql.operators.ColumnOperators.__add__"><tt class="xref py py-meth docutils literal"><span class="pre">operators.ColumnOperators.__add__()</span></tt></a>, can be overridden to provide
new operator behavior. The custom <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a> is passed to
the <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> instance via the <tt class="docutils literal"><span class="pre">comparator_factory</span></tt>
argument. In each case,
the appropriate subclass of <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a> should be used:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># definition of custom PropComparator subclasses</span>
<span class="kn">from</span> <span class="nn">sqlalchemy.orm.properties</span> <span class="kn">import</span> \
<span class="n">ColumnProperty</span><span class="p">,</span>\
<span class="n">CompositeProperty</span><span class="p">,</span>\
<span class="n">RelationshipProperty</span>
<span class="k">class</span> <span class="nc">MyColumnComparator</span><span class="p">(</span><span class="n">ColumnProperty</span><span class="o">.</span><span class="n">Comparator</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">__clause_element__</span><span class="p">()</span> <span class="o">==</span> <span class="n">other</span>
<span class="k">class</span> <span class="nc">MyRelationshipComparator</span><span class="p">(</span><span class="n">RelationshipProperty</span><span class="o">.</span><span class="n">Comparator</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">any</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">):</span>
<span class="s">"define the 'any' operation"</span>
<span class="c"># ...</span>
<span class="k">class</span> <span class="nc">MyCompositeComparator</span><span class="p">(</span><span class="n">CompositeProperty</span><span class="o">.</span><span class="n">Comparator</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">__gt__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="s">"redefine the 'greater than' operation"</span>
<span class="k">return</span> <span class="n">sql</span><span class="o">.</span><span class="n">and_</span><span class="p">(</span><span class="o">*</span><span class="p">[</span><span class="n">a</span><span class="o">></span><span class="n">b</span> <span class="k">for</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="ow">in</span>
<span class="nb">zip</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">__clause_element__</span><span class="p">()</span><span class="o">.</span><span class="n">clauses</span><span class="p">,</span>
<span class="n">other</span><span class="o">.</span><span class="n">__composite_values__</span><span class="p">())])</span>
<span class="c"># application of custom PropComparator subclasses</span>
<span class="kn">from</span> <span class="nn">sqlalchemy.orm</span> <span class="kn">import</span> <span class="n">column_property</span><span class="p">,</span> <span class="n">relationship</span><span class="p">,</span> <span class="n">composite</span>
<span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">Column</span><span class="p">,</span> <span class="n">String</span>
<span class="k">class</span> <span class="nc">SomeMappedClass</span><span class="p">(</span><span class="n">Base</span><span class="p">):</span>
<span class="n">some_column</span> <span class="o">=</span> <span class="n">column_property</span><span class="p">(</span><span class="n">Column</span><span class="p">(</span><span class="s">"some_column"</span><span class="p">,</span> <span class="n">String</span><span class="p">),</span>
<span class="n">comparator_factory</span><span class="o">=</span><span class="n">MyColumnComparator</span><span class="p">)</span>
<span class="n">some_relationship</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="n">SomeOtherClass</span><span class="p">,</span>
<span class="n">comparator_factory</span><span class="o">=</span><span class="n">MyRelationshipComparator</span><span class="p">)</span>
<span class="n">some_composite</span> <span class="o">=</span> <span class="n">composite</span><span class="p">(</span>
<span class="n">Column</span><span class="p">(</span><span class="s">"a"</span><span class="p">,</span> <span class="n">String</span><span class="p">),</span> <span class="n">Column</span><span class="p">(</span><span class="s">"b"</span><span class="p">,</span> <span class="n">String</span><span class="p">),</span>
<span class="n">comparator_factory</span><span class="o">=</span><span class="n">MyCompositeComparator</span>
<span class="p">)</span></pre></div>
</div>
<p>Note that for column-level operator redefinition, it’s usually
simpler to define the operators at the Core level, using the
<a class="reference internal" href="../core/types.html#sqlalchemy.types.TypeEngine.comparator_factory" title="sqlalchemy.types.TypeEngine.comparator_factory"><tt class="xref py py-attr docutils literal"><span class="pre">TypeEngine.comparator_factory</span></tt></a> attribute. See
<a class="reference internal" href="../core/types.html#types-operators"><em>Redefining and Creating New Operators</em></a> for more detail.</p>
<p>See also:</p>
<p><a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator" title="sqlalchemy.orm.properties.ColumnProperty.Comparator"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty.Comparator</span></tt></a></p>
<p><a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty.Comparator</span></tt></a></p>
<p><a class="reference internal" href="#sqlalchemy.orm.descriptor_props.CompositeProperty.Comparator" title="sqlalchemy.orm.descriptor_props.CompositeProperty.Comparator"><tt class="xref py py-class docutils literal"><span class="pre">CompositeProperty.Comparator</span></tt></a></p>
<p><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></p>
<p><a class="reference internal" href="../core/types.html#types-operators"><em>Redefining and Creating New Operators</em></a></p>
<p><a class="reference internal" href="../core/types.html#sqlalchemy.types.TypeEngine.comparator_factory" title="sqlalchemy.types.TypeEngine.comparator_factory"><tt class="xref py py-attr docutils literal"><span class="pre">TypeEngine.comparator_factory</span></tt></a></p>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.__eq__">
<tt class="descname">__eq__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__eq__" title="sqlalchemy.sql.operators.ColumnOperators.__eq__"><tt class="xref py py-meth docutils literal"><span class="pre">__eq__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">==</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">=</span> <span class="pre">b</span></tt>.
If the target is <tt class="docutils literal"><span class="pre">None</span></tt>, produces <tt class="docutils literal"><span class="pre">a</span> <span class="pre">IS</span> <span class="pre">NULL</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.__le__">
<tt class="descname">__le__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.__le__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__le__" title="sqlalchemy.sql.operators.ColumnOperators.__le__"><tt class="xref py py-meth docutils literal"><span class="pre">__le__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre"><=</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre"><=</span> <span class="pre">b</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.__lt__">
<tt class="descname">__lt__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.__lt__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__lt__" title="sqlalchemy.sql.operators.ColumnOperators.__lt__"><tt class="xref py py-meth docutils literal"><span class="pre">__lt__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre"><</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre"><</span> <span class="pre">b</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.__ne__">
<tt class="descname">__ne__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__ne__" title="sqlalchemy.sql.operators.ColumnOperators.__ne__"><tt class="xref py py-meth docutils literal"><span class="pre">__ne__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">!=</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">!=</span> <span class="pre">b</span></tt>.
If the target is <tt class="docutils literal"><span class="pre">None</span></tt>, produces <tt class="docutils literal"><span class="pre">a</span> <span class="pre">IS</span> <span class="pre">NOT</span> <span class="pre">NULL</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.adapt_to_entity">
<tt class="descname">adapt_to_entity</tt><big>(</big><em>adapt_to_entity</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.adapt_to_entity" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a copy of this PropComparator which will use the given
<a class="reference internal" href="query.html#sqlalchemy.orm.util.AliasedInsp" title="sqlalchemy.orm.util.AliasedInsp"><tt class="xref py py-class docutils literal"><span class="pre">AliasedInsp</span></tt></a> to produce corresponding expressions.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.interfaces.PropComparator.adapter">
<tt class="descname">adapter</tt><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.adapter" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a callable that adapts column expressions
to suit an aliased version of this comparator.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.any">
<tt class="descname">any</tt><big>(</big><em>criterion=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.any" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if this collection contains any member that meets the
given criterion.</p>
<p>The usual implementation of <tt class="docutils literal"><span class="pre">any()</span></tt> is
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.any" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.any"><tt class="xref py py-meth docutils literal"><span class="pre">RelationshipProperty.Comparator.any()</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.any.params.criterion"></span><strong>criterion</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.any.params.criterion">¶</a> – an optional ClauseElement formulated against the
member class’ table or attributes.</li>
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.any.params.**kwargs"></span><strong>**kwargs</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.any.params.**kwargs">¶</a> – key/value pairs corresponding to member class
attribute names which will be compared via equality to the
corresponding values.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.asc">
<tt class="descname">asc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.asc" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.asc" title="sqlalchemy.sql.operators.ColumnOperators.asc"><tt class="xref py py-meth docutils literal"><span class="pre">asc()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.asc" title="sqlalchemy.sql.expression.asc"><tt class="xref py py-func docutils literal"><span class="pre">asc()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.between">
<tt class="descname">between</tt><big>(</big><em>cleft</em>, <em>cright</em>, <em>symmetric=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.between" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.between" title="sqlalchemy.sql.operators.ColumnOperators.between"><tt class="xref py py-meth docutils literal"><span class="pre">between()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.between" title="sqlalchemy.sql.expression.between"><tt class="xref py py-func docutils literal"><span class="pre">between()</span></tt></a> clause against
the parent object, given the lower and upper range.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.collate">
<tt class="descname">collate</tt><big>(</big><em>collation</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.collate" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.collate" title="sqlalchemy.sql.operators.ColumnOperators.collate"><tt class="xref py py-meth docutils literal"><span class="pre">collate()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.collate" title="sqlalchemy.sql.expression.collate"><tt class="xref py py-func docutils literal"><span class="pre">collate()</span></tt></a> clause against
the parent object, given the collation string.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.concat">
<tt class="descname">concat</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.concat" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.concat" title="sqlalchemy.sql.operators.ColumnOperators.concat"><tt class="xref py py-meth docutils literal"><span class="pre">concat()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘concat’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">||</span> <span class="pre">b</span></tt>,
or uses the <tt class="docutils literal"><span class="pre">concat()</span></tt> operator on MySQL.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.contains">
<tt class="descname">contains</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.contains" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.contains" title="sqlalchemy.sql.operators.ColumnOperators.contains"><tt class="xref py py-meth docutils literal"><span class="pre">contains()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘contains’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'%<other>%'</span></tt></p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.desc">
<tt class="descname">desc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.desc" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.desc" title="sqlalchemy.sql.operators.ColumnOperators.desc"><tt class="xref py py-meth docutils literal"><span class="pre">desc()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.desc" title="sqlalchemy.sql.expression.desc"><tt class="xref py py-func docutils literal"><span class="pre">desc()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.distinct">
<tt class="descname">distinct</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.distinct" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.distinct" title="sqlalchemy.sql.operators.ColumnOperators.distinct"><tt class="xref py py-meth docutils literal"><span class="pre">distinct()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.distinct" title="sqlalchemy.sql.expression.distinct"><tt class="xref py py-func docutils literal"><span class="pre">distinct()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.endswith">
<tt class="descname">endswith</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.endswith" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.endswith" title="sqlalchemy.sql.operators.ColumnOperators.endswith"><tt class="xref py py-meth docutils literal"><span class="pre">endswith()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘endswith’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'%<other>'</span></tt></p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.has">
<tt class="descname">has</tt><big>(</big><em>criterion=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.has" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if this element references a member which meets the
given criterion.</p>
<p>The usual implementation of <tt class="docutils literal"><span class="pre">has()</span></tt> is
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.has" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.has"><tt class="xref py py-meth docutils literal"><span class="pre">RelationshipProperty.Comparator.has()</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.has.params.criterion"></span><strong>criterion</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.has.params.criterion">¶</a> – an optional ClauseElement formulated against the
member class’ table or attributes.</li>
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.has.params.**kwargs"></span><strong>**kwargs</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.has.params.**kwargs">¶</a> – key/value pairs corresponding to member class
attribute names which will be compared via equality to the
corresponding values.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.ilike">
<tt class="descname">ilike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.ilike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ilike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">ilike</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">ILIKE</span> <span class="pre">other</span></tt>.</p>
<p>E.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">sometable</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">sometable</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">column</span><span class="o">.</span><span class="n">ilike</span><span class="p">(</span><span class="s">"</span><span class="si">%f</span><span class="s">oobar%"</span><span class="p">))</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.ilike.params.other"></span><strong>other</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.ilike.params.other">¶</a> – expression to be compared</li>
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.ilike.params.escape"></span><strong>escape</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.ilike.params.escape">¶</a> – <p>optional escape character, renders the <tt class="docutils literal"><span class="pre">ESCAPE</span></tt>
keyword, e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">ilike</span><span class="p">(</span><span class="s">"foo/%bar"</span><span class="p">,</span> <span class="n">escape</span><span class="o">=</span><span class="s">"/"</span><span class="p">)</span></pre></div>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.in_">
<tt class="descname">in_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.in_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">in_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">in</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">IN</span> <span class="pre">other</span></tt>.
“other” may be a tuple/list of column expressions,
or a <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> construct.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.is_">
<tt class="descname">is_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.is_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.is_" title="sqlalchemy.sql.operators.ColumnOperators.is_"><tt class="xref py py-meth docutils literal"><span class="pre">is_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">IS</span></tt> operator.</p>
<p>Normally, <tt class="docutils literal"><span class="pre">IS</span></tt> is generated automatically when comparing to a
value of <tt class="docutils literal"><span class="pre">None</span></tt>, which resolves to <tt class="docutils literal"><span class="pre">NULL</span></tt>. However, explicit
usage of <tt class="docutils literal"><span class="pre">IS</span></tt> may be desirable if comparing to boolean values
on certain platforms.</p>
<div class="versionadded">
<p><span>New in version 0.7.9.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.isnot" title="sqlalchemy.sql.operators.ColumnOperators.isnot"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.isnot()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.isnot">
<tt class="descname">isnot</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.isnot" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.isnot" title="sqlalchemy.sql.operators.ColumnOperators.isnot"><tt class="xref py py-meth docutils literal"><span class="pre">isnot()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> operator.</p>
<p>Normally, <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> is generated automatically when comparing to a
value of <tt class="docutils literal"><span class="pre">None</span></tt>, which resolves to <tt class="docutils literal"><span class="pre">NULL</span></tt>. However, explicit
usage of <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> may be desirable if comparing to boolean values
on certain platforms.</p>
<div class="versionadded">
<p><span>New in version 0.7.9.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.is_" title="sqlalchemy.sql.operators.ColumnOperators.is_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.is_()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.like">
<tt class="descname">like</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.like" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">like()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">like</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">LIKE</span> <span class="pre">other</span></tt>.</p>
<p>E.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">sometable</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">sometable</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">column</span><span class="o">.</span><span class="n">like</span><span class="p">(</span><span class="s">"</span><span class="si">%f</span><span class="s">oobar%"</span><span class="p">))</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.like.params.other"></span><strong>other</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.like.params.other">¶</a> – expression to be compared</li>
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.like.params.escape"></span><strong>escape</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.like.params.escape">¶</a> – <p>optional escape character, renders the <tt class="docutils literal"><span class="pre">ESCAPE</span></tt>
keyword, e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">like</span><span class="p">(</span><span class="s">"foo/%bar"</span><span class="p">,</span> <span class="n">escape</span><span class="o">=</span><span class="s">"/"</span><span class="p">)</span></pre></div>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.match">
<tt class="descname">match</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.match" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.match" title="sqlalchemy.sql.operators.ColumnOperators.match"><tt class="xref py py-meth docutils literal"><span class="pre">match()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implements a database-specific ‘match’ operator.</p>
<p><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.match" title="sqlalchemy.sql.operators.ColumnOperators.match"><tt class="xref py py-meth docutils literal"><span class="pre">match()</span></tt></a> attempts to resolve to
a MATCH-like function or operator provided by the backend.
Examples include:</p>
<ul class="simple">
<li>Postgresql - renders <tt class="docutils literal"><span class="pre">x</span> <span class="pre">@@</span> <span class="pre">to_tsquery(y)</span></tt></li>
<li>MySQL - renders <tt class="docutils literal"><span class="pre">MATCH</span> <span class="pre">(x)</span> <span class="pre">AGAINST</span> <span class="pre">(y</span> <span class="pre">IN</span> <span class="pre">BOOLEAN</span> <span class="pre">MODE)</span></tt></li>
<li>Oracle - renders <tt class="docutils literal"><span class="pre">CONTAINS(x,</span> <span class="pre">y)</span></tt></li>
<li>other backends may provide special implementations;
some backends such as SQLite have no support.</li>
</ul>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.notilike">
<tt class="descname">notilike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.notilike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notilike" title="sqlalchemy.sql.operators.ColumnOperators.notilike"><tt class="xref py py-meth docutils literal"><span class="pre">notilike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">ILIKE</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.ilike(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.notin_">
<tt class="descname">notin_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.notin_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notin_" title="sqlalchemy.sql.operators.ColumnOperators.notin_"><tt class="xref py py-meth docutils literal"><span class="pre">notin_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">IN</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.in_()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.in_(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.in_()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.notlike">
<tt class="descname">notlike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.notlike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notlike" title="sqlalchemy.sql.operators.ColumnOperators.notlike"><tt class="xref py py-meth docutils literal"><span class="pre">notlike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">LIKE</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.like(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.nullsfirst">
<tt class="descname">nullsfirst</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.nullsfirst" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.nullsfirst" title="sqlalchemy.sql.operators.ColumnOperators.nullsfirst"><tt class="xref py py-meth docutils literal"><span class="pre">nullsfirst()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.nullsfirst" title="sqlalchemy.sql.expression.nullsfirst"><tt class="xref py py-func docutils literal"><span class="pre">nullsfirst()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.nullslast">
<tt class="descname">nullslast</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.nullslast" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.nullslast" title="sqlalchemy.sql.operators.ColumnOperators.nullslast"><tt class="xref py py-meth docutils literal"><span class="pre">nullslast()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.nullslast" title="sqlalchemy.sql.expression.nullslast"><tt class="xref py py-func docutils literal"><span class="pre">nullslast()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.of_type">
<tt class="descname">of_type</tt><big>(</big><em>class_</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.of_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Redefine this object in terms of a polymorphic subclass.</p>
<p>Returns a new PropComparator from which further criterion can be
evaluated.</p>
<p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">query</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">Company</span><span class="o">.</span><span class="n">employees</span><span class="o">.</span><span class="n">of_type</span><span class="p">(</span><span class="n">Engineer</span><span class="p">))</span><span class="o">.</span>\
<span class="nb">filter</span><span class="p">(</span><span class="n">Engineer</span><span class="o">.</span><span class="n">name</span><span class="o">==</span><span class="s">'foo'</span><span class="p">)</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.of_type.params.class_"></span><strong>class_</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.of_type.params.class_">¶</a> – a class or mapper indicating that criterion will be
against this specific subclass.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.op">
<tt class="descname">op</tt><big>(</big><em>opstring</em>, <em>precedence=0</em>, <em>is_comparison=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.op" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.op" title="sqlalchemy.sql.operators.Operators.op"><tt class="xref py py-meth docutils literal"><span class="pre">op()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators" title="sqlalchemy.sql.operators.Operators"><tt class="xref py py-class docutils literal"><span class="pre">Operators</span></tt></a></div>
<p>produce a generic operator function.</p>
<p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="s">"*"</span><span class="p">)(</span><span class="mi">5</span><span class="p">)</span></pre></div>
</div>
<p>produces:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span> <span class="o">*</span> <span class="mi">5</span></pre></div>
</div>
<p>This function can also be used to make bitwise operators explicit. For
example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="s">'&'</span><span class="p">)(</span><span class="mh">0xff</span><span class="p">)</span></pre></div>
</div>
<p>is a bitwise AND of the value in <tt class="docutils literal"><span class="pre">somecolumn</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.op.params.operator"></span><strong>operator</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.op.params.operator">¶</a> – a string which will be output as the infix operator
between this element and the expression passed to the
generated function.</li>
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.op.params.precedence"></span><strong>precedence</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.op.params.precedence">¶</a> – <p>precedence to apply to the operator, when
parenthesizing expressions. A lower number will cause the expression
to be parenthesized when applied against another operator with
higher precedence. The default value of <tt class="docutils literal"><span class="pre">0</span></tt> is lower than all
operators except for the comma (<tt class="docutils literal"><span class="pre">,</span></tt>) and <tt class="docutils literal"><span class="pre">AS</span></tt> operators.
A value of 100 will be higher or equal to all operators, and -100
will be lower than or equal to all operators.</p>
<div class="versionadded">
<p><span>New in version 0.8: </span>- added the ‘precedence’ argument.</p>
</div>
</li>
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.op.params.is_comparison"></span><strong>is_comparison</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.op.params.is_comparison">¶</a> – <p>if True, the operator will be considered as a
“comparison” operator, that is which evaulates to a boolean
true/false value, like <tt class="docutils literal"><span class="pre">==</span></tt>, <tt class="docutils literal"><span class="pre">></span></tt>, etc. This flag should be set
so that ORM relationships can establish that the operator is a
comparison operator when used in a custom join condition.</p>
<div class="versionadded">
<p><span>New in version 0.9.2: </span>- added the
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.op.params.is_comparison" title="sqlalchemy.sql.operators.Operators.op"><tt class="xref py py-paramref docutils literal"><span class="pre">Operators.op.is_comparison</span></tt></a> flag.</p>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="../core/types.html#types-operators"><em>Redefining and Creating New Operators</em></a></p>
<p class="last"><a class="reference internal" href="relationships.html#relationship-custom-operator"><em>Using custom operators in join conditions</em></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.operate">
<tt class="descname">operate</tt><big>(</big><em>op</em>, <em>*other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.operate" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.operate" title="sqlalchemy.sql.operators.Operators.operate"><tt class="xref py py-meth docutils literal"><span class="pre">operate()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators" title="sqlalchemy.sql.operators.Operators"><tt class="xref py py-class docutils literal"><span class="pre">Operators</span></tt></a></div>
<p>Operate on an argument.</p>
<p>This is the lowest level of operation, raises
<tt class="xref py py-class docutils literal"><span class="pre">NotImplementedError</span></tt> by default.</p>
<p>Overriding this on a subclass can allow common
behavior to be applied to all operations.
For example, overriding <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a>
to apply <tt class="docutils literal"><span class="pre">func.lower()</span></tt> to the left and right
side:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">MyComparator</span><span class="p">(</span><span class="n">ColumnOperators</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">operate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">op</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="n">op</span><span class="p">(</span><span class="n">func</span><span class="o">.</span><span class="n">lower</span><span class="p">(</span><span class="bp">self</span><span class="p">),</span> <span class="n">func</span><span class="o">.</span><span class="n">lower</span><span class="p">(</span><span class="n">other</span><span class="p">))</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.operate.params.op"></span><strong>op</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.operate.params.op">¶</a> – Operator callable.</li>
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.operate.params.*other"></span><strong>*other</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.operate.params.*other">¶</a> – the ‘other’ side of the operation. Will
be a single scalar for most operations.</li>
<li><span class="target" id="sqlalchemy.orm.interfaces.PropComparator.operate.params.**kwargs"></span><strong>**kwargs</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.operate.params.**kwargs">¶</a> – modifiers. These may be passed by special
operators such as <tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.contains()</span></tt>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.reverse_operate">
<tt class="descname">reverse_operate</tt><big>(</big><em>op</em>, <em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.reverse_operate" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.reverse_operate" title="sqlalchemy.sql.operators.Operators.reverse_operate"><tt class="xref py py-meth docutils literal"><span class="pre">reverse_operate()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators" title="sqlalchemy.sql.operators.Operators"><tt class="xref py py-class docutils literal"><span class="pre">Operators</span></tt></a></div>
<p>Reverse operate on an argument.</p>
<p>Usage is the same as <tt class="xref py py-meth docutils literal"><span class="pre">operate()</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.interfaces.PropComparator.startswith">
<tt class="descname">startswith</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.interfaces.PropComparator.startswith" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.startswith" title="sqlalchemy.sql.operators.ColumnOperators.startswith"><tt class="xref py py-meth docutils literal"><span class="pre">startswith()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">startwith</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'<other>%'</span></tt></p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.properties.RelationshipProperty">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.properties.</tt><tt class="descname">RelationshipProperty</tt><big>(</big><em>argument</em>, <em>secondary=None</em>, <em>primaryjoin=None</em>, <em>secondaryjoin=None</em>, <em>foreign_keys=None</em>, <em>uselist=None</em>, <em>order_by=False</em>, <em>backref=None</em>, <em>back_populates=None</em>, <em>post_update=False</em>, <em>cascade=False</em>, <em>extension=None</em>, <em>viewonly=False</em>, <em>lazy=True</em>, <em>collection_class=None</em>, <em>passive_deletes=False</em>, <em>passive_updates=True</em>, <em>remote_side=None</em>, <em>enable_typechecks=True</em>, <em>join_depth=None</em>, <em>comparator_factory=None</em>, <em>single_parent=False</em>, <em>innerjoin=False</em>, <em>distinct_target_key=None</em>, <em>doc=None</em>, <em>active_history=False</em>, <em>cascade_backrefs=True</em>, <em>load_on_pending=False</em>, <em>strategy_class=None</em>, <em>_local_remote_pairs=None</em>, <em>query_class=None</em>, <em>info=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.interfaces.StrategizedProperty</span></tt></p>
<p>Describes an object property that holds a single item or list
of items that correspond to a related database table.</p>
<p>Public constructor is the <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">orm.relationship()</span></tt></a> function.</p>
<p>See also:</p>
<p><a class="reference internal" href="relationships.html"><em>Relationship Configuration</em></a></p>
<dl class="class">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator">
<em class="property">class </em><tt class="descname">Comparator</tt><big>(</big><em>prop</em>, <em>parentmapper</em>, <em>adapt_to_entity=None</em>, <em>of_type=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.interfaces.PropComparator</span></tt></a></p>
<p>Produce boolean, comparison, and other operators for
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty" title="sqlalchemy.orm.properties.RelationshipProperty"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty</span></tt></a> attributes.</p>
<p>See the documentation for <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a> for a brief
overview of ORM level operator definition.</p>
<p>See also:</p>
<p><a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></p>
<p><a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty.Comparator" title="sqlalchemy.orm.properties.ColumnProperty.Comparator"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty.Comparator</span></tt></a></p>
<p><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></p>
<p><a class="reference internal" href="../core/types.html#types-operators"><em>Redefining and Creating New Operators</em></a></p>
<p><a class="reference internal" href="../core/types.html#sqlalchemy.types.TypeEngine.comparator_factory" title="sqlalchemy.types.TypeEngine.comparator_factory"><tt class="xref py py-attr docutils literal"><span class="pre">TypeEngine.comparator_factory</span></tt></a></p>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.__eq__">
<tt class="descname">__eq__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>Implement the <tt class="docutils literal"><span class="pre">==</span></tt> operator.</p>
<p>In a many-to-one context, such as:</p>
<div class="highlight-python"><pre>MyClass.some_prop == <some object></pre>
</div>
<p>this will typically produce a
clause such as:</p>
<div class="highlight-python"><pre>mytable.related_id == <some id></pre>
</div>
<p>Where <tt class="docutils literal"><span class="pre"><some</span> <span class="pre">id></span></tt> is the primary key of the given
object.</p>
<p>The <tt class="docutils literal"><span class="pre">==</span></tt> operator provides partial functionality for non-
many-to-one comparisons:</p>
<ul class="simple">
<li>Comparisons against collections are not supported.
Use <a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains"><tt class="xref py py-meth docutils literal"><span class="pre">contains()</span></tt></a>.</li>
<li>Compared to a scalar one-to-many, will produce a
clause that compares the target columns in the parent to
the given target.</li>
<li>Compared to a scalar many-to-many, an alias
of the association table will be rendered as
well, forming a natural join that is part of the
main body of the query. This will not work for
queries that go beyond simple AND conjunctions of
comparisons, such as those which use OR. Use
explicit joins, outerjoins, or
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.has" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.has"><tt class="xref py py-meth docutils literal"><span class="pre">has()</span></tt></a> for
more comprehensive non-many-to-one scalar
membership tests.</li>
<li>Comparisons against <tt class="docutils literal"><span class="pre">None</span></tt> given in a one-to-many
or many-to-many context produce a NOT EXISTS clause.</li>
</ul>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.__init__">
<tt class="descname">__init__</tt><big>(</big><em>prop</em>, <em>parentmapper</em>, <em>adapt_to_entity=None</em>, <em>of_type=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construction of <a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty.Comparator</span></tt></a>
is internal to the ORM’s attribute mechanics.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.__le__">
<tt class="descname">__le__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.__le__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__le__" title="sqlalchemy.sql.operators.ColumnOperators.__le__"><tt class="xref py py-meth docutils literal"><span class="pre">__le__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre"><=</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre"><=</span> <span class="pre">b</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.__lt__">
<tt class="descname">__lt__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.__lt__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__lt__" title="sqlalchemy.sql.operators.ColumnOperators.__lt__"><tt class="xref py py-meth docutils literal"><span class="pre">__lt__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre"><</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre"><</span> <span class="pre">b</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.__ne__">
<tt class="descname">__ne__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><p>Implement the <tt class="docutils literal"><span class="pre">!=</span></tt> operator.</p>
<p>In a many-to-one context, such as:</p>
<div class="highlight-python"><pre>MyClass.some_prop != <some object></pre>
</div>
<p>This will typically produce a clause such as:</p>
<div class="highlight-python"><pre>mytable.related_id != <some id></pre>
</div>
<p>Where <tt class="docutils literal"><span class="pre"><some</span> <span class="pre">id></span></tt> is the primary key of the
given object.</p>
<p>The <tt class="docutils literal"><span class="pre">!=</span></tt> operator provides partial functionality for non-
many-to-one comparisons:</p>
<ul class="simple">
<li>Comparisons against collections are not supported.
Use
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains"><tt class="xref py py-meth docutils literal"><span class="pre">contains()</span></tt></a>
in conjunction with <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.not_" title="sqlalchemy.sql.expression.not_"><tt class="xref py py-func docutils literal"><span class="pre">not_()</span></tt></a>.</li>
<li>Compared to a scalar one-to-many, will produce a
clause that compares the target columns in the parent to
the given target.</li>
<li>Compared to a scalar many-to-many, an alias
of the association table will be rendered as
well, forming a natural join that is part of the
main body of the query. This will not work for
queries that go beyond simple AND conjunctions of
comparisons, such as those which use OR. Use
explicit joins, outerjoins, or
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.has" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.has"><tt class="xref py py-meth docutils literal"><span class="pre">has()</span></tt></a> in
conjunction with <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.not_" title="sqlalchemy.sql.expression.not_"><tt class="xref py py-func docutils literal"><span class="pre">not_()</span></tt></a> for
more comprehensive non-many-to-one scalar
membership tests.</li>
<li>Comparisons against <tt class="docutils literal"><span class="pre">None</span></tt> given in a one-to-many
or many-to-many context produce an EXISTS clause.</li>
</ul>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.adapter">
<tt class="descname">adapter</tt><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.adapter" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.adapter" title="sqlalchemy.orm.interfaces.PropComparator.adapter"><tt class="xref py py-attr docutils literal"><span class="pre">adapter</span></tt></a> <em>attribute of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></div>
<p>Produce a callable that adapts column expressions
to suit an aliased version of this comparator.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.any">
<tt class="descname">any</tt><big>(</big><em>criterion=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.any" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce an expression that tests a collection against
particular criterion, using EXISTS.</p>
<p>An expression like:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">session</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">MyClass</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span>
<span class="n">MyClass</span><span class="o">.</span><span class="n">somereference</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">SomeRelated</span><span class="o">.</span><span class="n">x</span><span class="o">==</span><span class="mi">2</span><span class="p">)</span>
<span class="p">)</span></pre></div>
</div>
<p>Will produce a query like:</p>
<div class="highlight-python"><pre>SELECT * FROM my_table WHERE
EXISTS (SELECT 1 FROM related WHERE related.my_id=my_table.id
AND related.x=2)</pre>
</div>
<p>Because <a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.any" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.any"><tt class="xref py py-meth docutils literal"><span class="pre">any()</span></tt></a> uses
a correlated subquery, its performance is not nearly as
good when compared against large target tables as that of
using a join.</p>
<p><a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.any" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.any"><tt class="xref py py-meth docutils literal"><span class="pre">any()</span></tt></a> is particularly
useful for testing for empty collections:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">session</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">MyClass</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span>
<span class="o">~</span><span class="n">MyClass</span><span class="o">.</span><span class="n">somereference</span><span class="o">.</span><span class="n">any</span><span class="p">()</span>
<span class="p">)</span></pre></div>
</div>
<p>will produce:</p>
<div class="highlight-python"><pre>SELECT * FROM my_table WHERE
NOT EXISTS (SELECT 1 FROM related WHERE
related.my_id=my_table.id)</pre>
</div>
<p><a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.any" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.any"><tt class="xref py py-meth docutils literal"><span class="pre">any()</span></tt></a> is only
valid for collections, i.e. a <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>
that has <tt class="docutils literal"><span class="pre">uselist=True</span></tt>. For scalar references,
use <a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.has" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.has"><tt class="xref py py-meth docutils literal"><span class="pre">has()</span></tt></a>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.asc">
<tt class="descname">asc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.asc" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.asc" title="sqlalchemy.sql.operators.ColumnOperators.asc"><tt class="xref py py-meth docutils literal"><span class="pre">asc()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.asc" title="sqlalchemy.sql.expression.asc"><tt class="xref py py-func docutils literal"><span class="pre">asc()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.between">
<tt class="descname">between</tt><big>(</big><em>cleft</em>, <em>cright</em>, <em>symmetric=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.between" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.between" title="sqlalchemy.sql.operators.ColumnOperators.between"><tt class="xref py py-meth docutils literal"><span class="pre">between()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.between" title="sqlalchemy.sql.expression.between"><tt class="xref py py-func docutils literal"><span class="pre">between()</span></tt></a> clause against
the parent object, given the lower and upper range.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.collate">
<tt class="descname">collate</tt><big>(</big><em>collation</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.collate" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.collate" title="sqlalchemy.sql.operators.ColumnOperators.collate"><tt class="xref py py-meth docutils literal"><span class="pre">collate()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.collate" title="sqlalchemy.sql.expression.collate"><tt class="xref py py-func docutils literal"><span class="pre">collate()</span></tt></a> clause against
the parent object, given the collation string.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.concat">
<tt class="descname">concat</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.concat" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.concat" title="sqlalchemy.sql.operators.ColumnOperators.concat"><tt class="xref py py-meth docutils literal"><span class="pre">concat()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘concat’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">||</span> <span class="pre">b</span></tt>,
or uses the <tt class="docutils literal"><span class="pre">concat()</span></tt> operator on MySQL.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains">
<tt class="descname">contains</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a simple expression that tests a collection for
containment of a particular item.</p>
<p><a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains"><tt class="xref py py-meth docutils literal"><span class="pre">contains()</span></tt></a> is
only valid for a collection, i.e. a
<a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a> that implements
one-to-many or many-to-many with <tt class="docutils literal"><span class="pre">uselist=True</span></tt>.</p>
<p>When used in a simple one-to-many context, an
expression like:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">MyClass</span><span class="o">.</span><span class="n">contains</span><span class="p">(</span><span class="n">other</span><span class="p">)</span></pre></div>
</div>
<p>Produces a clause like:</p>
<div class="highlight-python"><pre>mytable.id == <some id></pre>
</div>
<p>Where <tt class="docutils literal"><span class="pre"><some</span> <span class="pre">id></span></tt> is the value of the foreign key
attribute on <tt class="docutils literal"><span class="pre">other</span></tt> which refers to the primary
key of its parent object. From this it follows that
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains"><tt class="xref py py-meth docutils literal"><span class="pre">contains()</span></tt></a> is
very useful when used with simple one-to-many
operations.</p>
<p>For many-to-many operations, the behavior of
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains"><tt class="xref py py-meth docutils literal"><span class="pre">contains()</span></tt></a>
has more caveats. The association table will be
rendered in the statement, producing an “implicit”
join, that is, includes multiple tables in the FROM
clause which are equated in the WHERE clause:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">query</span><span class="p">(</span><span class="n">MyClass</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">MyClass</span><span class="o">.</span><span class="n">contains</span><span class="p">(</span><span class="n">other</span><span class="p">))</span></pre></div>
</div>
<p>Produces a query like:</p>
<div class="highlight-python"><pre>SELECT * FROM my_table, my_association_table AS
my_association_table_1 WHERE
my_table.id = my_association_table_1.parent_id
AND my_association_table_1.child_id = <some id></pre>
</div>
<p>Where <tt class="docutils literal"><span class="pre"><some</span> <span class="pre">id></span></tt> would be the primary key of
<tt class="docutils literal"><span class="pre">other</span></tt>. From the above, it is clear that
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains"><tt class="xref py py-meth docutils literal"><span class="pre">contains()</span></tt></a>
will <strong>not</strong> work with many-to-many collections when
used in queries that move beyond simple AND
conjunctions, such as multiple
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.contains"><tt class="xref py py-meth docutils literal"><span class="pre">contains()</span></tt></a>
expressions joined by OR. In such cases subqueries or
explicit “outer joins” will need to be used instead.
See <a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.any" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.any"><tt class="xref py py-meth docutils literal"><span class="pre">any()</span></tt></a> for
a less-performant alternative using EXISTS, or refer
to <a class="reference internal" href="query.html#sqlalchemy.orm.query.Query.outerjoin" title="sqlalchemy.orm.query.Query.outerjoin"><tt class="xref py py-meth docutils literal"><span class="pre">Query.outerjoin()</span></tt></a> as well as <a class="reference internal" href="tutorial.html#ormtutorial-joins"><em>Querying with Joins</em></a>
for more details on constructing outer joins.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.desc">
<tt class="descname">desc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.desc" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.desc" title="sqlalchemy.sql.operators.ColumnOperators.desc"><tt class="xref py py-meth docutils literal"><span class="pre">desc()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.desc" title="sqlalchemy.sql.expression.desc"><tt class="xref py py-func docutils literal"><span class="pre">desc()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.distinct">
<tt class="descname">distinct</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.distinct" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.distinct" title="sqlalchemy.sql.operators.ColumnOperators.distinct"><tt class="xref py py-meth docutils literal"><span class="pre">distinct()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.distinct" title="sqlalchemy.sql.expression.distinct"><tt class="xref py py-func docutils literal"><span class="pre">distinct()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.endswith">
<tt class="descname">endswith</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.endswith" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.endswith" title="sqlalchemy.sql.operators.ColumnOperators.endswith"><tt class="xref py py-meth docutils literal"><span class="pre">endswith()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘endswith’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'%<other>'</span></tt></p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.has">
<tt class="descname">has</tt><big>(</big><em>criterion=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.has" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce an expression that tests a scalar reference against
particular criterion, using EXISTS.</p>
<p>An expression like:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">session</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">MyClass</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span>
<span class="n">MyClass</span><span class="o">.</span><span class="n">somereference</span><span class="o">.</span><span class="n">has</span><span class="p">(</span><span class="n">SomeRelated</span><span class="o">.</span><span class="n">x</span><span class="o">==</span><span class="mi">2</span><span class="p">)</span>
<span class="p">)</span></pre></div>
</div>
<p>Will produce a query like:</p>
<div class="highlight-python"><pre>SELECT * FROM my_table WHERE
EXISTS (SELECT 1 FROM related WHERE
related.id==my_table.related_id AND related.x=2)</pre>
</div>
<p>Because <a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.has" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.has"><tt class="xref py py-meth docutils literal"><span class="pre">has()</span></tt></a> uses
a correlated subquery, its performance is not nearly as
good when compared against large target tables as that of
using a join.</p>
<p><a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.has" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.has"><tt class="xref py py-meth docutils literal"><span class="pre">has()</span></tt></a> is only
valid for scalar references, i.e. a <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>
that has <tt class="docutils literal"><span class="pre">uselist=False</span></tt>. For collection references,
use <a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.any" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.any"><tt class="xref py py-meth docutils literal"><span class="pre">any()</span></tt></a>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.ilike">
<tt class="descname">ilike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.ilike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ilike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">ilike</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">ILIKE</span> <span class="pre">other</span></tt>.</p>
<p>E.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">sometable</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">sometable</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">column</span><span class="o">.</span><span class="n">ilike</span><span class="p">(</span><span class="s">"</span><span class="si">%f</span><span class="s">oobar%"</span><span class="p">))</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.ilike.params.other"></span><strong>other</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.ilike.params.other">¶</a> – expression to be compared</li>
<li><span class="target" id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.ilike.params.escape"></span><strong>escape</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.ilike.params.escape">¶</a> – <p>optional escape character, renders the <tt class="docutils literal"><span class="pre">ESCAPE</span></tt>
keyword, e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">ilike</span><span class="p">(</span><span class="s">"foo/%bar"</span><span class="p">,</span> <span class="n">escape</span><span class="o">=</span><span class="s">"/"</span><span class="p">)</span></pre></div>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.in_">
<tt class="descname">in_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.in_" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce an IN clause - this is not implemented
for <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>-based attributes at this time.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.is_">
<tt class="descname">is_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.is_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.is_" title="sqlalchemy.sql.operators.ColumnOperators.is_"><tt class="xref py py-meth docutils literal"><span class="pre">is_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">IS</span></tt> operator.</p>
<p>Normally, <tt class="docutils literal"><span class="pre">IS</span></tt> is generated automatically when comparing to a
value of <tt class="docutils literal"><span class="pre">None</span></tt>, which resolves to <tt class="docutils literal"><span class="pre">NULL</span></tt>. However, explicit
usage of <tt class="docutils literal"><span class="pre">IS</span></tt> may be desirable if comparing to boolean values
on certain platforms.</p>
<div class="versionadded">
<p><span>New in version 0.7.9.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.isnot" title="sqlalchemy.sql.operators.ColumnOperators.isnot"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.isnot()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.isnot">
<tt class="descname">isnot</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.isnot" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.isnot" title="sqlalchemy.sql.operators.ColumnOperators.isnot"><tt class="xref py py-meth docutils literal"><span class="pre">isnot()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> operator.</p>
<p>Normally, <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> is generated automatically when comparing to a
value of <tt class="docutils literal"><span class="pre">None</span></tt>, which resolves to <tt class="docutils literal"><span class="pre">NULL</span></tt>. However, explicit
usage of <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> may be desirable if comparing to boolean values
on certain platforms.</p>
<div class="versionadded">
<p><span>New in version 0.7.9.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.is_" title="sqlalchemy.sql.operators.ColumnOperators.is_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.is_()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.like">
<tt class="descname">like</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.like" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">like()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">like</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">LIKE</span> <span class="pre">other</span></tt>.</p>
<p>E.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">sometable</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">sometable</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">column</span><span class="o">.</span><span class="n">like</span><span class="p">(</span><span class="s">"</span><span class="si">%f</span><span class="s">oobar%"</span><span class="p">))</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.like.params.other"></span><strong>other</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.like.params.other">¶</a> – expression to be compared</li>
<li><span class="target" id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.like.params.escape"></span><strong>escape</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.like.params.escape">¶</a> – <p>optional escape character, renders the <tt class="docutils literal"><span class="pre">ESCAPE</span></tt>
keyword, e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">like</span><span class="p">(</span><span class="s">"foo/%bar"</span><span class="p">,</span> <span class="n">escape</span><span class="o">=</span><span class="s">"/"</span><span class="p">)</span></pre></div>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a></p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.mapper">
<tt class="descname">mapper</tt><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.mapper" title="Permalink to this definition">¶</a></dt>
<dd><p>The target <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.mapper.Mapper" title="sqlalchemy.orm.mapper.Mapper"><tt class="xref py py-class docutils literal"><span class="pre">Mapper</span></tt></a> referred to by this
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty.Comparator</span></tt></a>.</p>
<p>This is the “target” or “remote” side of the
<a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.match">
<tt class="descname">match</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.match" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.match" title="sqlalchemy.sql.operators.ColumnOperators.match"><tt class="xref py py-meth docutils literal"><span class="pre">match()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implements a database-specific ‘match’ operator.</p>
<p><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.match" title="sqlalchemy.sql.operators.ColumnOperators.match"><tt class="xref py py-meth docutils literal"><span class="pre">match()</span></tt></a> attempts to resolve to
a MATCH-like function or operator provided by the backend.
Examples include:</p>
<ul class="simple">
<li>Postgresql - renders <tt class="docutils literal"><span class="pre">x</span> <span class="pre">@@</span> <span class="pre">to_tsquery(y)</span></tt></li>
<li>MySQL - renders <tt class="docutils literal"><span class="pre">MATCH</span> <span class="pre">(x)</span> <span class="pre">AGAINST</span> <span class="pre">(y</span> <span class="pre">IN</span> <span class="pre">BOOLEAN</span> <span class="pre">MODE)</span></tt></li>
<li>Oracle - renders <tt class="docutils literal"><span class="pre">CONTAINS(x,</span> <span class="pre">y)</span></tt></li>
<li>other backends may provide special implementations;
some backends such as SQLite have no support.</li>
</ul>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.notilike">
<tt class="descname">notilike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.notilike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notilike" title="sqlalchemy.sql.operators.ColumnOperators.notilike"><tt class="xref py py-meth docutils literal"><span class="pre">notilike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">ILIKE</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.ilike(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.notin_">
<tt class="descname">notin_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.notin_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notin_" title="sqlalchemy.sql.operators.ColumnOperators.notin_"><tt class="xref py py-meth docutils literal"><span class="pre">notin_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">IN</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.in_()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.in_(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.in_()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.notlike">
<tt class="descname">notlike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.notlike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notlike" title="sqlalchemy.sql.operators.ColumnOperators.notlike"><tt class="xref py py-meth docutils literal"><span class="pre">notlike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">LIKE</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.like(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.nullsfirst">
<tt class="descname">nullsfirst</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.nullsfirst" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.nullsfirst" title="sqlalchemy.sql.operators.ColumnOperators.nullsfirst"><tt class="xref py py-meth docutils literal"><span class="pre">nullsfirst()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.nullsfirst" title="sqlalchemy.sql.expression.nullsfirst"><tt class="xref py py-func docutils literal"><span class="pre">nullsfirst()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.nullslast">
<tt class="descname">nullslast</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.nullslast" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.nullslast" title="sqlalchemy.sql.operators.ColumnOperators.nullslast"><tt class="xref py py-meth docutils literal"><span class="pre">nullslast()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.nullslast" title="sqlalchemy.sql.expression.nullslast"><tt class="xref py py-func docutils literal"><span class="pre">nullslast()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.of_type">
<tt class="descname">of_type</tt><big>(</big><em>cls</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.of_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a construct that represents a particular ‘subtype’ of
attribute for the parent class.</p>
<p>Currently this is usable in conjunction with <a class="reference internal" href="query.html#sqlalchemy.orm.query.Query.join" title="sqlalchemy.orm.query.Query.join"><tt class="xref py py-meth docutils literal"><span class="pre">Query.join()</span></tt></a>
and <a class="reference internal" href="query.html#sqlalchemy.orm.query.Query.outerjoin" title="sqlalchemy.orm.query.Query.outerjoin"><tt class="xref py py-meth docutils literal"><span class="pre">Query.outerjoin()</span></tt></a>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.op">
<tt class="descname">op</tt><big>(</big><em>opstring</em>, <em>precedence=0</em>, <em>is_comparison=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.op" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.op" title="sqlalchemy.sql.operators.Operators.op"><tt class="xref py py-meth docutils literal"><span class="pre">op()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators" title="sqlalchemy.sql.operators.Operators"><tt class="xref py py-class docutils literal"><span class="pre">Operators</span></tt></a></div>
<p>produce a generic operator function.</p>
<p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="s">"*"</span><span class="p">)(</span><span class="mi">5</span><span class="p">)</span></pre></div>
</div>
<p>produces:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span> <span class="o">*</span> <span class="mi">5</span></pre></div>
</div>
<p>This function can also be used to make bitwise operators explicit. For
example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="s">'&'</span><span class="p">)(</span><span class="mh">0xff</span><span class="p">)</span></pre></div>
</div>
<p>is a bitwise AND of the value in <tt class="docutils literal"><span class="pre">somecolumn</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.op.params.operator"></span><strong>operator</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.op.params.operator">¶</a> – a string which will be output as the infix operator
between this element and the expression passed to the
generated function.</li>
<li><span class="target" id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.op.params.precedence"></span><strong>precedence</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.op.params.precedence">¶</a> – <p>precedence to apply to the operator, when
parenthesizing expressions. A lower number will cause the expression
to be parenthesized when applied against another operator with
higher precedence. The default value of <tt class="docutils literal"><span class="pre">0</span></tt> is lower than all
operators except for the comma (<tt class="docutils literal"><span class="pre">,</span></tt>) and <tt class="docutils literal"><span class="pre">AS</span></tt> operators.
A value of 100 will be higher or equal to all operators, and -100
will be lower than or equal to all operators.</p>
<div class="versionadded">
<p><span>New in version 0.8: </span>- added the ‘precedence’ argument.</p>
</div>
</li>
<li><span class="target" id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.op.params.is_comparison"></span><strong>is_comparison</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.op.params.is_comparison">¶</a> – <p>if True, the operator will be considered as a
“comparison” operator, that is which evaulates to a boolean
true/false value, like <tt class="docutils literal"><span class="pre">==</span></tt>, <tt class="docutils literal"><span class="pre">></span></tt>, etc. This flag should be set
so that ORM relationships can establish that the operator is a
comparison operator when used in a custom join condition.</p>
<div class="versionadded">
<p><span>New in version 0.9.2: </span>- added the
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.op.params.is_comparison" title="sqlalchemy.sql.operators.Operators.op"><tt class="xref py py-paramref docutils literal"><span class="pre">Operators.op.is_comparison</span></tt></a> flag.</p>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="../core/types.html#types-operators"><em>Redefining and Creating New Operators</em></a></p>
<p class="last"><a class="reference internal" href="relationships.html#relationship-custom-operator"><em>Using custom operators in join conditions</em></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.operate">
<tt class="descname">operate</tt><big>(</big><em>op</em>, <em>*other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.operate" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.operate" title="sqlalchemy.sql.operators.Operators.operate"><tt class="xref py py-meth docutils literal"><span class="pre">operate()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators" title="sqlalchemy.sql.operators.Operators"><tt class="xref py py-class docutils literal"><span class="pre">Operators</span></tt></a></div>
<p>Operate on an argument.</p>
<p>This is the lowest level of operation, raises
<tt class="xref py py-class docutils literal"><span class="pre">NotImplementedError</span></tt> by default.</p>
<p>Overriding this on a subclass can allow common
behavior to be applied to all operations.
For example, overriding <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a>
to apply <tt class="docutils literal"><span class="pre">func.lower()</span></tt> to the left and right
side:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">MyComparator</span><span class="p">(</span><span class="n">ColumnOperators</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">operate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">op</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="n">op</span><span class="p">(</span><span class="n">func</span><span class="o">.</span><span class="n">lower</span><span class="p">(</span><span class="bp">self</span><span class="p">),</span> <span class="n">func</span><span class="o">.</span><span class="n">lower</span><span class="p">(</span><span class="n">other</span><span class="p">))</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.operate.params.op"></span><strong>op</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.operate.params.op">¶</a> – Operator callable.</li>
<li><span class="target" id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.operate.params.*other"></span><strong>*other</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.operate.params.*other">¶</a> – the ‘other’ side of the operation. Will
be a single scalar for most operations.</li>
<li><span class="target" id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.operate.params.**kwargs"></span><strong>**kwargs</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.operate.params.**kwargs">¶</a> – modifiers. These may be passed by special
operators such as <tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.contains()</span></tt>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.reverse_operate">
<tt class="descname">reverse_operate</tt><big>(</big><em>op</em>, <em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.reverse_operate" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.reverse_operate" title="sqlalchemy.sql.operators.Operators.reverse_operate"><tt class="xref py py-meth docutils literal"><span class="pre">reverse_operate()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators" title="sqlalchemy.sql.operators.Operators"><tt class="xref py py-class docutils literal"><span class="pre">Operators</span></tt></a></div>
<p>Reverse operate on an argument.</p>
<p>Usage is the same as <tt class="xref py py-meth docutils literal"><span class="pre">operate()</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.Comparator.startswith">
<tt class="descname">startswith</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.startswith" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.startswith" title="sqlalchemy.sql.operators.ColumnOperators.startswith"><tt class="xref py py-meth docutils literal"><span class="pre">startswith()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">startwith</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'<other>%'</span></tt></p>
</dd></dl>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.__init__">
<tt class="descclassname">RelationshipProperty.</tt><tt class="descname">__init__</tt><big>(</big><em>argument</em>, <em>secondary=None</em>, <em>primaryjoin=None</em>, <em>secondaryjoin=None</em>, <em>foreign_keys=None</em>, <em>uselist=None</em>, <em>order_by=False</em>, <em>backref=None</em>, <em>back_populates=None</em>, <em>post_update=False</em>, <em>cascade=False</em>, <em>extension=None</em>, <em>viewonly=False</em>, <em>lazy=True</em>, <em>collection_class=None</em>, <em>passive_deletes=False</em>, <em>passive_updates=True</em>, <em>remote_side=None</em>, <em>enable_typechecks=True</em>, <em>join_depth=None</em>, <em>comparator_factory=None</em>, <em>single_parent=False</em>, <em>innerjoin=False</em>, <em>distinct_target_key=None</em>, <em>doc=None</em>, <em>active_history=False</em>, <em>cascade_backrefs=True</em>, <em>load_on_pending=False</em>, <em>strategy_class=None</em>, <em>_local_remote_pairs=None</em>, <em>query_class=None</em>, <em>info=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new <a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty" title="sqlalchemy.orm.properties.RelationshipProperty"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty</span></tt></a> object.</p>
<p>This constructor is mirrored as a public API function; see <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a> for a full usage and argument description.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.cascade">
<tt class="descclassname">RelationshipProperty.</tt><tt class="descname">cascade</tt><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.cascade" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the current cascade setting for this
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty" title="sqlalchemy.orm.properties.RelationshipProperty"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.class_attribute">
<tt class="descclassname">RelationshipProperty.</tt><tt class="descname">class_attribute</tt><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.class_attribute" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.class_attribute" title="sqlalchemy.orm.interfaces.MapperProperty.class_attribute"><tt class="xref py py-attr docutils literal"><span class="pre">class_attribute</span></tt></a> <em>attribute of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Return the class-bound descriptor corresponding to this
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>.</p>
<p>This is basically a <tt class="docutils literal"><span class="pre">getattr()</span></tt> call:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">class_</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span></pre></div>
</div>
<p>I.e. if this <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> were named <tt class="docutils literal"><span class="pre">addresses</span></tt>,
and the class to which it is mapped is <tt class="docutils literal"><span class="pre">User</span></tt>, this sequence
is possible:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">inspect</span>
<span class="gp">>>> </span><span class="n">mapper</span> <span class="o">=</span> <span class="n">inspect</span><span class="p">(</span><span class="n">User</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">addresses_property</span> <span class="o">=</span> <span class="n">mapper</span><span class="o">.</span><span class="n">attrs</span><span class="o">.</span><span class="n">addresses</span>
<span class="gp">>>> </span><span class="n">addresses_property</span><span class="o">.</span><span class="n">class_attribute</span> <span class="ow">is</span> <span class="n">User</span><span class="o">.</span><span class="n">addresses</span>
<span class="go">True</span>
<span class="gp">>>> </span><span class="n">User</span><span class="o">.</span><span class="n">addresses</span><span class="o">.</span><span class="n">property</span> <span class="ow">is</span> <span class="n">addresses_property</span>
<span class="go">True</span></pre></div>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.extension_type">
<tt class="descclassname">RelationshipProperty.</tt><tt class="descname">extension_type</tt><em class="property"> = symbol('NOT_EXTENSION')</em><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.extension_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.info">
<tt class="descclassname">RelationshipProperty.</tt><tt class="descname">info</tt><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.info" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.info" title="sqlalchemy.orm.interfaces.MapperProperty.info"><tt class="xref py py-attr docutils literal"><span class="pre">info</span></tt></a> <em>attribute of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Info dictionary associated with the object, allowing user-defined
data to be associated with this <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>.</p>
<p>The dictionary is generated when first accessed. Alternatively,
it can be specified as a constructor argument to the
<a class="reference internal" href="mapper_config.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><tt class="xref py py-func docutils literal"><span class="pre">column_property()</span></tt></a>, <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>, or <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.composite" title="sqlalchemy.orm.composite"><tt class="xref py py-func docutils literal"><span class="pre">composite()</span></tt></a>
functions.</p>
<div class="versionadded">
<p><span>New in version 0.8: </span>Added support for .info to all
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> subclasses.</p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.info" title="sqlalchemy.orm.attributes.QueryableAttribute.info"><tt class="xref py py-attr docutils literal"><span class="pre">QueryableAttribute.info</span></tt></a></p>
<p class="last"><a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.SchemaItem.info" title="sqlalchemy.schema.SchemaItem.info"><tt class="xref py py-attr docutils literal"><span class="pre">SchemaItem.info</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.init">
<tt class="descclassname">RelationshipProperty.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.init" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.init" title="sqlalchemy.orm.interfaces.MapperProperty.init"><tt class="xref py py-meth docutils literal"><span class="pre">init()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Called after all mappers are created to assemble
relationships between mappers and perform other post-mapper-creation
initialization steps.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.is_primary">
<tt class="descclassname">RelationshipProperty.</tt><tt class="descname">is_primary</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.is_primary" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.is_primary" title="sqlalchemy.orm.interfaces.MapperProperty.is_primary"><tt class="xref py py-meth docutils literal"><span class="pre">is_primary()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Return True if this <tt class="docutils literal"><span class="pre">MapperProperty</span></tt>‘s mapper is the
primary mapper for its class.</p>
<p>This flag is used to indicate that the <tt class="docutils literal"><span class="pre">MapperProperty</span></tt> can
define attribute instrumentation for the class at the class
level (as opposed to the individual instance level).</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.mapper">
<tt class="descclassname">RelationshipProperty.</tt><tt class="descname">mapper</tt><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.mapper" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the targeted <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.mapper.Mapper" title="sqlalchemy.orm.mapper.Mapper"><tt class="xref py py-class docutils literal"><span class="pre">Mapper</span></tt></a> for this
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty" title="sqlalchemy.orm.properties.RelationshipProperty"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty</span></tt></a>.</p>
<p>This is a lazy-initializing static attribute.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.properties.RelationshipProperty.table">
<tt class="descclassname">RelationshipProperty.</tt><tt class="descname">table</tt><a class="headerlink" href="#sqlalchemy.orm.properties.RelationshipProperty.table" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the selectable linked to this
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty" title="sqlalchemy.orm.properties.RelationshipProperty"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty</span></tt></a> object’s target
<a class="reference internal" href="mapper_config.html#sqlalchemy.orm.mapper.Mapper" title="sqlalchemy.orm.mapper.Mapper"><tt class="xref py py-class docutils literal"><span class="pre">Mapper</span></tt></a>.</p>
<div class="deprecated">
<p><span>Deprecated since version 0.7: </span>Use .target</p>
</div>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.descriptor_props.</tt><tt class="descname">SynonymProperty</tt><big>(</big><em>name</em>, <em>map_column=None</em>, <em>descriptor=None</em>, <em>comparator_factory=None</em>, <em>doc=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.descriptor_props.DescriptorProperty</span></tt></p>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.__init__">
<tt class="descname">__init__</tt><big>(</big><em>name</em>, <em>map_column=None</em>, <em>descriptor=None</em>, <em>comparator_factory=None</em>, <em>doc=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new <a class="reference internal" href="#sqlalchemy.orm.descriptor_props.SynonymProperty" title="sqlalchemy.orm.descriptor_props.SynonymProperty"><tt class="xref py py-class docutils literal"><span class="pre">SynonymProperty</span></tt></a> object.</p>
<p>This constructor is mirrored as a public API function; see <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.synonym" title="sqlalchemy.orm.synonym"><tt class="xref py py-func docutils literal"><span class="pre">synonym()</span></tt></a> for a full usage and argument description.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.cascade_iterator">
<tt class="descname">cascade_iterator</tt><big>(</big><em>type_</em>, <em>state</em>, <em>visited_instances=None</em>, <em>halt_on=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.cascade_iterator" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.cascade_iterator" title="sqlalchemy.orm.interfaces.MapperProperty.cascade_iterator"><tt class="xref py py-meth docutils literal"><span class="pre">cascade_iterator()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Iterate through instances related to the given instance for
a particular ‘cascade’, starting with this MapperProperty.</p>
<p>Return an iterator3-tuples (instance, mapper, state).</p>
<p>Note that the ‘cascade’ collection on this MapperProperty is
checked first for the given type before cascade_iterator is called.</p>
<p>See PropertyLoader for the related instance implementation.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.class_attribute">
<tt class="descname">class_attribute</tt><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.class_attribute" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.class_attribute" title="sqlalchemy.orm.interfaces.MapperProperty.class_attribute"><tt class="xref py py-attr docutils literal"><span class="pre">class_attribute</span></tt></a> <em>attribute of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Return the class-bound descriptor corresponding to this
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>.</p>
<p>This is basically a <tt class="docutils literal"><span class="pre">getattr()</span></tt> call:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">class_</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span></pre></div>
</div>
<p>I.e. if this <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> were named <tt class="docutils literal"><span class="pre">addresses</span></tt>,
and the class to which it is mapped is <tt class="docutils literal"><span class="pre">User</span></tt>, this sequence
is possible:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">inspect</span>
<span class="gp">>>> </span><span class="n">mapper</span> <span class="o">=</span> <span class="n">inspect</span><span class="p">(</span><span class="n">User</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">addresses_property</span> <span class="o">=</span> <span class="n">mapper</span><span class="o">.</span><span class="n">attrs</span><span class="o">.</span><span class="n">addresses</span>
<span class="gp">>>> </span><span class="n">addresses_property</span><span class="o">.</span><span class="n">class_attribute</span> <span class="ow">is</span> <span class="n">User</span><span class="o">.</span><span class="n">addresses</span>
<span class="go">True</span>
<span class="gp">>>> </span><span class="n">User</span><span class="o">.</span><span class="n">addresses</span><span class="o">.</span><span class="n">property</span> <span class="ow">is</span> <span class="n">addresses_property</span>
<span class="go">True</span></pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.compare">
<tt class="descname">compare</tt><big>(</big><em>operator</em>, <em>value</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.compare" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.compare" title="sqlalchemy.orm.interfaces.MapperProperty.compare"><tt class="xref py py-meth docutils literal"><span class="pre">compare()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Return a compare operation for the columns represented by
this <tt class="docutils literal"><span class="pre">MapperProperty</span></tt> to the given value, which may be a
column value or an instance. ‘operator’ is an operator from
the operators module, or from sql.Comparator.</p>
<p>By default uses the PropComparator attached to this MapperProperty
under the attribute name “comparator”.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.create_row_processor">
<tt class="descname">create_row_processor</tt><big>(</big><em>context</em>, <em>path</em>, <em>mapper</em>, <em>row</em>, <em>adapter</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.create_row_processor" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.create_row_processor" title="sqlalchemy.orm.interfaces.MapperProperty.create_row_processor"><tt class="xref py py-meth docutils literal"><span class="pre">create_row_processor()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Return a 3-tuple consisting of three row processing functions.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.do_init">
<tt class="descname">do_init</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.do_init" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.do_init" title="sqlalchemy.orm.interfaces.MapperProperty.do_init"><tt class="xref py py-meth docutils literal"><span class="pre">do_init()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Perform subclass-specific initialization post-mapper-creation
steps.</p>
<p>This is a template method called by the <tt class="docutils literal"><span class="pre">MapperProperty</span></tt>
object’s init() method.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.extension_type">
<tt class="descname">extension_type</tt><em class="property"> = symbol('NOT_EXTENSION')</em><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.extension_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.info">
<tt class="descname">info</tt><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.info" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.info" title="sqlalchemy.orm.interfaces.MapperProperty.info"><tt class="xref py py-attr docutils literal"><span class="pre">info</span></tt></a> <em>attribute of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Info dictionary associated with the object, allowing user-defined
data to be associated with this <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>.</p>
<p>The dictionary is generated when first accessed. Alternatively,
it can be specified as a constructor argument to the
<a class="reference internal" href="mapper_config.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><tt class="xref py py-func docutils literal"><span class="pre">column_property()</span></tt></a>, <a class="reference internal" href="relationships.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><tt class="xref py py-func docutils literal"><span class="pre">relationship()</span></tt></a>, or <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.composite" title="sqlalchemy.orm.composite"><tt class="xref py py-func docutils literal"><span class="pre">composite()</span></tt></a>
functions.</p>
<div class="versionadded">
<p><span>New in version 0.8: </span>Added support for .info to all
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> subclasses.</p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.info" title="sqlalchemy.orm.attributes.QueryableAttribute.info"><tt class="xref py py-attr docutils literal"><span class="pre">QueryableAttribute.info</span></tt></a></p>
<p class="last"><a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.SchemaItem.info" title="sqlalchemy.schema.SchemaItem.info"><tt class="xref py py-attr docutils literal"><span class="pre">SchemaItem.info</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.init">
<tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.init" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.init" title="sqlalchemy.orm.interfaces.MapperProperty.init"><tt class="xref py py-meth docutils literal"><span class="pre">init()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Called after all mappers are created to assemble
relationships between mappers and perform other post-mapper-creation
initialization steps.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.is_primary">
<tt class="descname">is_primary</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.is_primary" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.is_primary" title="sqlalchemy.orm.interfaces.MapperProperty.is_primary"><tt class="xref py py-meth docutils literal"><span class="pre">is_primary()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Return True if this <tt class="docutils literal"><span class="pre">MapperProperty</span></tt>‘s mapper is the
primary mapper for its class.</p>
<p>This flag is used to indicate that the <tt class="docutils literal"><span class="pre">MapperProperty</span></tt> can
define attribute instrumentation for the class at the class
level (as opposed to the individual instance level).</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.merge">
<tt class="descname">merge</tt><big>(</big><em>session</em>, <em>source_state</em>, <em>source_dict</em>, <em>dest_state</em>, <em>dest_dict</em>, <em>load</em>, <em>_recursive</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.merge" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.merge" title="sqlalchemy.orm.interfaces.MapperProperty.merge"><tt class="xref py py-meth docutils literal"><span class="pre">merge()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Merge the attribute represented by this <tt class="docutils literal"><span class="pre">MapperProperty</span></tt>
from source to destination object</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.post_instrument_class">
<tt class="descname">post_instrument_class</tt><big>(</big><em>mapper</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.post_instrument_class" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.post_instrument_class" title="sqlalchemy.orm.interfaces.MapperProperty.post_instrument_class"><tt class="xref py py-meth docutils literal"><span class="pre">post_instrument_class()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Perform instrumentation adjustments that need to occur
after init() has completed.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.descriptor_props.SynonymProperty.setup">
<tt class="descname">setup</tt><big>(</big><em>context</em>, <em>entity</em>, <em>path</em>, <em>adapter</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.descriptor_props.SynonymProperty.setup" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.setup" title="sqlalchemy.orm.interfaces.MapperProperty.setup"><tt class="xref py py-meth docutils literal"><span class="pre">setup()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></div>
<p>Called by Query for the purposes of constructing a SQL statement.</p>
<p>Each MapperProperty associated with the target mapper processes the
statement referenced by the query context, adding columns and/or
criterion as appropriate.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.query.QueryContext">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.query.</tt><tt class="descname">QueryContext</tt><big>(</big><em>query</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.query.QueryContext" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.attributes.</tt><tt class="descname">QueryableAttribute</tt><big>(</big><em>class_</em>, <em>key</em>, <em>impl=None</em>, <em>comparator=None</em>, <em>parententity=None</em>, <em>of_type=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.base._MappedAttribute</span></tt>, <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.base._InspectionAttr</span></tt>, <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.orm.interfaces.PropComparator</span></tt></a></p>
<p>Base class for <a class="reference internal" href="../glossary.html#term-descriptor"><em class="xref std std-term">descriptor</em></a> objects that intercept
attribute events on behalf of a <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>
object. The actual <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> is accessible
via the <a class="reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.property" title="sqlalchemy.orm.attributes.QueryableAttribute.property"><tt class="xref py py-attr docutils literal"><span class="pre">QueryableAttribute.property</span></tt></a>
attribute.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="#sqlalchemy.orm.attributes.InstrumentedAttribute" title="sqlalchemy.orm.attributes.InstrumentedAttribute"><tt class="xref py py-class docutils literal"><span class="pre">InstrumentedAttribute</span></tt></a></p>
<p><a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a></p>
<p><a class="reference internal" href="mapper_config.html#sqlalchemy.orm.mapper.Mapper.all_orm_descriptors" title="sqlalchemy.orm.mapper.Mapper.all_orm_descriptors"><tt class="xref py py-attr docutils literal"><span class="pre">Mapper.all_orm_descriptors</span></tt></a></p>
<p class="last"><a class="reference internal" href="mapper_config.html#sqlalchemy.orm.mapper.Mapper.attrs" title="sqlalchemy.orm.mapper.Mapper.attrs"><tt class="xref py py-attr docutils literal"><span class="pre">Mapper.attrs</span></tt></a></p>
</div>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.__eq__">
<tt class="descname">__eq__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__eq__" title="sqlalchemy.sql.operators.ColumnOperators.__eq__"><tt class="xref py py-meth docutils literal"><span class="pre">__eq__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">==</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">=</span> <span class="pre">b</span></tt>.
If the target is <tt class="docutils literal"><span class="pre">None</span></tt>, produces <tt class="docutils literal"><span class="pre">a</span> <span class="pre">IS</span> <span class="pre">NULL</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.__le__">
<tt class="descname">__le__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.__le__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__le__" title="sqlalchemy.sql.operators.ColumnOperators.__le__"><tt class="xref py py-meth docutils literal"><span class="pre">__le__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre"><=</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre"><=</span> <span class="pre">b</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.__lt__">
<tt class="descname">__lt__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.__lt__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__lt__" title="sqlalchemy.sql.operators.ColumnOperators.__lt__"><tt class="xref py py-meth docutils literal"><span class="pre">__lt__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre"><</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre"><</span> <span class="pre">b</span></tt>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.__ne__">
<tt class="descname">__ne__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.__ne__" title="sqlalchemy.sql.operators.ColumnOperators.__ne__"><tt class="xref py py-meth docutils literal"><span class="pre">__ne__()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">!=</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">!=</span> <span class="pre">b</span></tt>.
If the target is <tt class="docutils literal"><span class="pre">None</span></tt>, produces <tt class="docutils literal"><span class="pre">a</span> <span class="pre">IS</span> <span class="pre">NOT</span> <span class="pre">NULL</span></tt>.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.adapter">
<tt class="descname">adapter</tt><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.adapter" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.adapter" title="sqlalchemy.orm.interfaces.PropComparator.adapter"><tt class="xref py py-attr docutils literal"><span class="pre">adapter</span></tt></a> <em>attribute of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></div>
<p>Produce a callable that adapts column expressions
to suit an aliased version of this comparator.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.any">
<tt class="descname">any</tt><big>(</big><em>criterion=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.any" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.any" title="sqlalchemy.orm.interfaces.PropComparator.any"><tt class="xref py py-meth docutils literal"><span class="pre">any()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></div>
<p>Return true if this collection contains any member that meets the
given criterion.</p>
<p>The usual implementation of <tt class="docutils literal"><span class="pre">any()</span></tt> is
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.any" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.any"><tt class="xref py py-meth docutils literal"><span class="pre">RelationshipProperty.Comparator.any()</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.any.params.criterion"></span><strong>criterion</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.any.params.criterion">¶</a> – an optional ClauseElement formulated against the
member class’ table or attributes.</li>
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.any.params.**kwargs"></span><strong>**kwargs</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.any.params.**kwargs">¶</a> – key/value pairs corresponding to member class
attribute names which will be compared via equality to the
corresponding values.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.asc">
<tt class="descname">asc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.asc" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.asc" title="sqlalchemy.sql.operators.ColumnOperators.asc"><tt class="xref py py-meth docutils literal"><span class="pre">asc()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.asc" title="sqlalchemy.sql.expression.asc"><tt class="xref py py-func docutils literal"><span class="pre">asc()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.between">
<tt class="descname">between</tt><big>(</big><em>cleft</em>, <em>cright</em>, <em>symmetric=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.between" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.between" title="sqlalchemy.sql.operators.ColumnOperators.between"><tt class="xref py py-meth docutils literal"><span class="pre">between()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.between" title="sqlalchemy.sql.expression.between"><tt class="xref py py-func docutils literal"><span class="pre">between()</span></tt></a> clause against
the parent object, given the lower and upper range.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.collate">
<tt class="descname">collate</tt><big>(</big><em>collation</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.collate" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.collate" title="sqlalchemy.sql.operators.ColumnOperators.collate"><tt class="xref py py-meth docutils literal"><span class="pre">collate()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.collate" title="sqlalchemy.sql.expression.collate"><tt class="xref py py-func docutils literal"><span class="pre">collate()</span></tt></a> clause against
the parent object, given the collation string.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.concat">
<tt class="descname">concat</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.concat" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.concat" title="sqlalchemy.sql.operators.ColumnOperators.concat"><tt class="xref py py-meth docutils literal"><span class="pre">concat()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘concat’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">||</span> <span class="pre">b</span></tt>,
or uses the <tt class="docutils literal"><span class="pre">concat()</span></tt> operator on MySQL.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.contains">
<tt class="descname">contains</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.contains" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.contains" title="sqlalchemy.sql.operators.ColumnOperators.contains"><tt class="xref py py-meth docutils literal"><span class="pre">contains()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘contains’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'%<other>%'</span></tt></p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.desc">
<tt class="descname">desc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.desc" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.desc" title="sqlalchemy.sql.operators.ColumnOperators.desc"><tt class="xref py py-meth docutils literal"><span class="pre">desc()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.desc" title="sqlalchemy.sql.expression.desc"><tt class="xref py py-func docutils literal"><span class="pre">desc()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.distinct">
<tt class="descname">distinct</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.distinct" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.distinct" title="sqlalchemy.sql.operators.ColumnOperators.distinct"><tt class="xref py py-meth docutils literal"><span class="pre">distinct()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.distinct" title="sqlalchemy.sql.expression.distinct"><tt class="xref py py-func docutils literal"><span class="pre">distinct()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.endswith">
<tt class="descname">endswith</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.endswith" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.endswith" title="sqlalchemy.sql.operators.ColumnOperators.endswith"><tt class="xref py py-meth docutils literal"><span class="pre">endswith()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the ‘endswith’ operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'%<other>'</span></tt></p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.extension_type">
<tt class="descname">extension_type</tt><em class="property"> = symbol('NOT_EXTENSION')</em><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.extension_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.has">
<tt class="descname">has</tt><big>(</big><em>criterion=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.has" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator.has" title="sqlalchemy.orm.interfaces.PropComparator.has"><tt class="xref py py-meth docutils literal"><span class="pre">has()</span></tt></a> <em>method of</em> <a class="reference internal" href="#sqlalchemy.orm.interfaces.PropComparator" title="sqlalchemy.orm.interfaces.PropComparator"><tt class="xref py py-class docutils literal"><span class="pre">PropComparator</span></tt></a></div>
<p>Return true if this element references a member which meets the
given criterion.</p>
<p>The usual implementation of <tt class="docutils literal"><span class="pre">has()</span></tt> is
<a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty.Comparator.has" title="sqlalchemy.orm.properties.RelationshipProperty.Comparator.has"><tt class="xref py py-meth docutils literal"><span class="pre">RelationshipProperty.Comparator.has()</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.has.params.criterion"></span><strong>criterion</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.has.params.criterion">¶</a> – an optional ClauseElement formulated against the
member class’ table or attributes.</li>
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.has.params.**kwargs"></span><strong>**kwargs</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.has.params.**kwargs">¶</a> – key/value pairs corresponding to member class
attribute names which will be compared via equality to the
corresponding values.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.ilike">
<tt class="descname">ilike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.ilike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ilike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">ilike</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">ILIKE</span> <span class="pre">other</span></tt>.</p>
<p>E.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">sometable</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">sometable</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">column</span><span class="o">.</span><span class="n">ilike</span><span class="p">(</span><span class="s">"</span><span class="si">%f</span><span class="s">oobar%"</span><span class="p">))</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.ilike.params.other"></span><strong>other</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.ilike.params.other">¶</a> – expression to be compared</li>
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.ilike.params.escape"></span><strong>escape</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.ilike.params.escape">¶</a> – <p>optional escape character, renders the <tt class="docutils literal"><span class="pre">ESCAPE</span></tt>
keyword, e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">ilike</span><span class="p">(</span><span class="s">"foo/%bar"</span><span class="p">,</span> <span class="n">escape</span><span class="o">=</span><span class="s">"/"</span><span class="p">)</span></pre></div>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.in_">
<tt class="descname">in_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.in_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">in_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">in</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">IN</span> <span class="pre">other</span></tt>.
“other” may be a tuple/list of column expressions,
or a <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> construct.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.info">
<tt class="descname">info</tt><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.info" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the ‘info’ dictionary for the underlying SQL element.</p>
<p>The behavior here is as follows:</p>
<ul class="simple">
<li>If the attribute is a column-mapped property, i.e.
<a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty" title="sqlalchemy.orm.properties.ColumnProperty"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty</span></tt></a>, which is mapped directly
to a schema-level <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt></a> object, this attribute
will return the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.SchemaItem.info" title="sqlalchemy.schema.SchemaItem.info"><tt class="xref py py-attr docutils literal"><span class="pre">SchemaItem.info</span></tt></a> dictionary associated
with the core-level <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt></a> object.</li>
<li>If the attribute is a <a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty" title="sqlalchemy.orm.properties.ColumnProperty"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty</span></tt></a> but is mapped to
any other kind of SQL expression other than a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt></a>,
the attribute will refer to the <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.info" title="sqlalchemy.orm.interfaces.MapperProperty.info"><tt class="xref py py-attr docutils literal"><span class="pre">MapperProperty.info</span></tt></a>
dictionary associated directly with the <a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty" title="sqlalchemy.orm.properties.ColumnProperty"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty</span></tt></a>,
assuming the SQL expression itself does not have its own <tt class="docutils literal"><span class="pre">.info</span></tt>
attribute (which should be the case, unless a user-defined SQL
construct has defined one).</li>
<li>If the attribute refers to any other kind of
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>, including <a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty" title="sqlalchemy.orm.properties.RelationshipProperty"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty</span></tt></a>,
the attribute will refer to the <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.info" title="sqlalchemy.orm.interfaces.MapperProperty.info"><tt class="xref py py-attr docutils literal"><span class="pre">MapperProperty.info</span></tt></a>
dictionary associated with that <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a>.</li>
<li>To access the <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.info" title="sqlalchemy.orm.interfaces.MapperProperty.info"><tt class="xref py py-attr docutils literal"><span class="pre">MapperProperty.info</span></tt></a> dictionary of the
<a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> unconditionally, including for a
<a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty" title="sqlalchemy.orm.properties.ColumnProperty"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty</span></tt></a> that’s associated directly with a
<a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">schema.Column</span></tt></a>, the attribute can be referred to using
<a class="reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.property" title="sqlalchemy.orm.attributes.QueryableAttribute.property"><tt class="xref py py-attr docutils literal"><span class="pre">QueryableAttribute.property</span></tt></a> attribute, as
<tt class="docutils literal"><span class="pre">MyClass.someattribute.property.info</span></tt>.</li>
</ul>
<div class="versionadded">
<p><span>New in version 0.8.0.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.SchemaItem.info" title="sqlalchemy.schema.SchemaItem.info"><tt class="xref py py-attr docutils literal"><span class="pre">SchemaItem.info</span></tt></a></p>
<p class="last"><a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty.info" title="sqlalchemy.orm.interfaces.MapperProperty.info"><tt class="xref py py-attr docutils literal"><span class="pre">MapperProperty.info</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.is_">
<tt class="descname">is_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.is_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.is_" title="sqlalchemy.sql.operators.ColumnOperators.is_"><tt class="xref py py-meth docutils literal"><span class="pre">is_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">IS</span></tt> operator.</p>
<p>Normally, <tt class="docutils literal"><span class="pre">IS</span></tt> is generated automatically when comparing to a
value of <tt class="docutils literal"><span class="pre">None</span></tt>, which resolves to <tt class="docutils literal"><span class="pre">NULL</span></tt>. However, explicit
usage of <tt class="docutils literal"><span class="pre">IS</span></tt> may be desirable if comparing to boolean values
on certain platforms.</p>
<div class="versionadded">
<p><span>New in version 0.7.9.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.isnot" title="sqlalchemy.sql.operators.ColumnOperators.isnot"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.isnot()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.isnot">
<tt class="descname">isnot</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.isnot" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.isnot" title="sqlalchemy.sql.operators.ColumnOperators.isnot"><tt class="xref py py-meth docutils literal"><span class="pre">isnot()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> operator.</p>
<p>Normally, <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> is generated automatically when comparing to a
value of <tt class="docutils literal"><span class="pre">None</span></tt>, which resolves to <tt class="docutils literal"><span class="pre">NULL</span></tt>. However, explicit
usage of <tt class="docutils literal"><span class="pre">IS</span> <span class="pre">NOT</span></tt> may be desirable if comparing to boolean values
on certain platforms.</p>
<div class="versionadded">
<p><span>New in version 0.7.9.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.is_" title="sqlalchemy.sql.operators.ColumnOperators.is_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.is_()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.like">
<tt class="descname">like</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.like" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">like()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">like</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">a</span> <span class="pre">LIKE</span> <span class="pre">other</span></tt>.</p>
<p>E.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">sometable</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">sometable</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">column</span><span class="o">.</span><span class="n">like</span><span class="p">(</span><span class="s">"</span><span class="si">%f</span><span class="s">oobar%"</span><span class="p">))</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.like.params.other"></span><strong>other</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.like.params.other">¶</a> – expression to be compared</li>
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.like.params.escape"></span><strong>escape</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.like.params.escape">¶</a> – <p>optional escape character, renders the <tt class="docutils literal"><span class="pre">ESCAPE</span></tt>
keyword, e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">like</span><span class="p">(</span><span class="s">"foo/%bar"</span><span class="p">,</span> <span class="n">escape</span><span class="o">=</span><span class="s">"/"</span><span class="p">)</span></pre></div>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.match">
<tt class="descname">match</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.match" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.match" title="sqlalchemy.sql.operators.ColumnOperators.match"><tt class="xref py py-meth docutils literal"><span class="pre">match()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implements a database-specific ‘match’ operator.</p>
<p><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.match" title="sqlalchemy.sql.operators.ColumnOperators.match"><tt class="xref py py-meth docutils literal"><span class="pre">match()</span></tt></a> attempts to resolve to
a MATCH-like function or operator provided by the backend.
Examples include:</p>
<ul class="simple">
<li>Postgresql - renders <tt class="docutils literal"><span class="pre">x</span> <span class="pre">@@</span> <span class="pre">to_tsquery(y)</span></tt></li>
<li>MySQL - renders <tt class="docutils literal"><span class="pre">MATCH</span> <span class="pre">(x)</span> <span class="pre">AGAINST</span> <span class="pre">(y</span> <span class="pre">IN</span> <span class="pre">BOOLEAN</span> <span class="pre">MODE)</span></tt></li>
<li>Oracle - renders <tt class="docutils literal"><span class="pre">CONTAINS(x,</span> <span class="pre">y)</span></tt></li>
<li>other backends may provide special implementations;
some backends such as SQLite have no support.</li>
</ul>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.notilike">
<tt class="descname">notilike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.notilike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notilike" title="sqlalchemy.sql.operators.ColumnOperators.notilike"><tt class="xref py py-meth docutils literal"><span class="pre">notilike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">ILIKE</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.ilike(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.ilike" title="sqlalchemy.sql.operators.ColumnOperators.ilike"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.ilike()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.notin_">
<tt class="descname">notin_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.notin_" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notin_" title="sqlalchemy.sql.operators.ColumnOperators.notin_"><tt class="xref py py-meth docutils literal"><span class="pre">notin_()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">IN</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.in_()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.in_(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.in_" title="sqlalchemy.sql.operators.ColumnOperators.in_"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.in_()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.notlike">
<tt class="descname">notlike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.notlike" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.notlike" title="sqlalchemy.sql.operators.ColumnOperators.notlike"><tt class="xref py py-meth docutils literal"><span class="pre">notlike()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>implement the <tt class="docutils literal"><span class="pre">NOT</span> <span class="pre">LIKE</span></tt> operator.</p>
<p>This is equivalent to using negation with
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a>, i.e. <tt class="docutils literal"><span class="pre">~x.like(y)</span></tt>.</p>
<div class="versionadded">
<p><span>New in version 0.8.</span></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><tt class="xref py py-meth docutils literal"><span class="pre">ColumnOperators.like()</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.nullsfirst">
<tt class="descname">nullsfirst</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.nullsfirst" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.nullsfirst" title="sqlalchemy.sql.operators.ColumnOperators.nullsfirst"><tt class="xref py py-meth docutils literal"><span class="pre">nullsfirst()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.nullsfirst" title="sqlalchemy.sql.expression.nullsfirst"><tt class="xref py py-func docutils literal"><span class="pre">nullsfirst()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.nullslast">
<tt class="descname">nullslast</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.nullslast" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.nullslast" title="sqlalchemy.sql.operators.ColumnOperators.nullslast"><tt class="xref py py-meth docutils literal"><span class="pre">nullslast()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Produce a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.nullslast" title="sqlalchemy.sql.expression.nullslast"><tt class="xref py py-func docutils literal"><span class="pre">nullslast()</span></tt></a> clause against the
parent object.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.op">
<tt class="descname">op</tt><big>(</big><em>opstring</em>, <em>precedence=0</em>, <em>is_comparison=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.op" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.op" title="sqlalchemy.sql.operators.Operators.op"><tt class="xref py py-meth docutils literal"><span class="pre">op()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators" title="sqlalchemy.sql.operators.Operators"><tt class="xref py py-class docutils literal"><span class="pre">Operators</span></tt></a></div>
<p>produce a generic operator function.</p>
<p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="s">"*"</span><span class="p">)(</span><span class="mi">5</span><span class="p">)</span></pre></div>
</div>
<p>produces:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span> <span class="o">*</span> <span class="mi">5</span></pre></div>
</div>
<p>This function can also be used to make bitwise operators explicit. For
example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="s">'&'</span><span class="p">)(</span><span class="mh">0xff</span><span class="p">)</span></pre></div>
</div>
<p>is a bitwise AND of the value in <tt class="docutils literal"><span class="pre">somecolumn</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.op.params.operator"></span><strong>operator</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.op.params.operator">¶</a> – a string which will be output as the infix operator
between this element and the expression passed to the
generated function.</li>
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.op.params.precedence"></span><strong>precedence</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.op.params.precedence">¶</a> – <p>precedence to apply to the operator, when
parenthesizing expressions. A lower number will cause the expression
to be parenthesized when applied against another operator with
higher precedence. The default value of <tt class="docutils literal"><span class="pre">0</span></tt> is lower than all
operators except for the comma (<tt class="docutils literal"><span class="pre">,</span></tt>) and <tt class="docutils literal"><span class="pre">AS</span></tt> operators.
A value of 100 will be higher or equal to all operators, and -100
will be lower than or equal to all operators.</p>
<div class="versionadded">
<p><span>New in version 0.8: </span>- added the ‘precedence’ argument.</p>
</div>
</li>
<li><span class="target" id="sqlalchemy.orm.attributes.QueryableAttribute.op.params.is_comparison"></span><strong>is_comparison</strong><a class="paramlink headerlink reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute.op.params.is_comparison">¶</a> – <p>if True, the operator will be considered as a
“comparison” operator, that is which evaulates to a boolean
true/false value, like <tt class="docutils literal"><span class="pre">==</span></tt>, <tt class="docutils literal"><span class="pre">></span></tt>, etc. This flag should be set
so that ORM relationships can establish that the operator is a
comparison operator when used in a custom join condition.</p>
<div class="versionadded">
<p><span>New in version 0.9.2: </span>- added the
<a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.op.params.is_comparison" title="sqlalchemy.sql.operators.Operators.op"><tt class="xref py py-paramref docutils literal"><span class="pre">Operators.op.is_comparison</span></tt></a> flag.</p>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="../core/types.html#types-operators"><em>Redefining and Creating New Operators</em></a></p>
<p class="last"><a class="reference internal" href="relationships.html#relationship-custom-operator"><em>Using custom operators in join conditions</em></a></p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.parent">
<tt class="descname">parent</tt><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an inspection instance representing the parent.</p>
<p>This will be either an instance of <a class="reference internal" href="mapper_config.html#sqlalchemy.orm.mapper.Mapper" title="sqlalchemy.orm.mapper.Mapper"><tt class="xref py py-class docutils literal"><span class="pre">Mapper</span></tt></a>
or <a class="reference internal" href="query.html#sqlalchemy.orm.util.AliasedInsp" title="sqlalchemy.orm.util.AliasedInsp"><tt class="xref py py-class docutils literal"><span class="pre">AliasedInsp</span></tt></a>, depending upon the nature
of the parent entity which this attribute is associated
with.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.property">
<tt class="descname">property</tt><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.property" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the <a class="reference internal" href="#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><tt class="xref py py-class docutils literal"><span class="pre">MapperProperty</span></tt></a> associated with this
<a class="reference internal" href="#sqlalchemy.orm.attributes.QueryableAttribute" title="sqlalchemy.orm.attributes.QueryableAttribute"><tt class="xref py py-class docutils literal"><span class="pre">QueryableAttribute</span></tt></a>.</p>
<p>Return values here will commonly be instances of
<a class="reference internal" href="#sqlalchemy.orm.properties.ColumnProperty" title="sqlalchemy.orm.properties.ColumnProperty"><tt class="xref py py-class docutils literal"><span class="pre">ColumnProperty</span></tt></a> or <a class="reference internal" href="#sqlalchemy.orm.properties.RelationshipProperty" title="sqlalchemy.orm.properties.RelationshipProperty"><tt class="xref py py-class docutils literal"><span class="pre">RelationshipProperty</span></tt></a>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.attributes.QueryableAttribute.startswith">
<tt class="descname">startswith</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.attributes.QueryableAttribute.startswith" title="Permalink to this definition">¶</a></dt>
<dd><div class="inherited-member container">
<em>inherited from the</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.startswith" title="sqlalchemy.sql.operators.ColumnOperators.startswith"><tt class="xref py py-meth docutils literal"><span class="pre">startswith()</span></tt></a> <em>method of</em> <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators" title="sqlalchemy.sql.operators.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">ColumnOperators</span></tt></a></div>
<p>Implement the <tt class="docutils literal"><span class="pre">startwith</span></tt> operator.</p>
<p>In a column context, produces the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'<other>%'</span></tt></p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="sqlalchemy.orm.session.UOWTransaction">
<em class="property">class </em><tt class="descclassname">sqlalchemy.orm.session.</tt><tt class="descname">UOWTransaction</tt><big>(</big><em>session</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.session.UOWTransaction" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="sqlalchemy.orm.session.UOWTransaction.filter_states_for_dep">
<tt class="descname">filter_states_for_dep</tt><big>(</big><em>dep</em>, <em>states</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.session.UOWTransaction.filter_states_for_dep" title="Permalink to this definition">¶</a></dt>
<dd><p>Filter the given list of InstanceStates to those relevant to the
given DependencyProcessor.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.session.UOWTransaction.finalize_flush_changes">
<tt class="descname">finalize_flush_changes</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.orm.session.UOWTransaction.finalize_flush_changes" title="Permalink to this definition">¶</a></dt>
<dd><p>mark processed objects as clean / deleted after a successful
flush().</p>
<p>this method is called within the flush() method after the
execute() method has succeeded and the transaction has been committed.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.session.UOWTransaction.get_attribute_history">
<tt class="descname">get_attribute_history</tt><big>(</big><em>state</em>, <em>key</em>, <em>passive=symbol('PASSIVE_NO_INITIALIZE')</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.session.UOWTransaction.get_attribute_history" title="Permalink to this definition">¶</a></dt>
<dd><p>facade to attributes.get_state_history(), including
caching of results.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.session.UOWTransaction.is_deleted">
<tt class="descname">is_deleted</tt><big>(</big><em>state</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.session.UOWTransaction.is_deleted" title="Permalink to this definition">¶</a></dt>
<dd><p>return true if the given state is marked as deleted
within this uowtransaction.</p>
</dd></dl>
<dl class="method">
<dt id="sqlalchemy.orm.session.UOWTransaction.remove_state_actions">
<tt class="descname">remove_state_actions</tt><big>(</big><em>state</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.session.UOWTransaction.remove_state_actions" title="Permalink to this definition">¶</a></dt>
<dd><p>remove pending actions for a state from the uowtransaction.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
<div id="docs-bottom-navigation" class="docs-navigation-links">
Previous:
<a href="exceptions.html" title="previous chapter">ORM Exceptions</a>
Next:
<a href="../core/index.html" title="next chapter">SQLAlchemy Core</a>
<div id="docs-copyright">
© <a href="../copyright.html">Copyright</a> 2007-2014, the SQLAlchemy authors and contributors.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.2b1.
</div>
</div>
</div>
</body>
</html>
|