mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
add support for ?field__isnull=1 (#107)
* add support for ?field__isnull=1 * Add unit test and conditional formatting for ?field__isnull
This commit is contained in:
parent
b9af49be6c
commit
ed2b3f25be
2 changed files with 17 additions and 3 deletions
|
|
@ -88,6 +88,15 @@ def test_custom_json_encoder(obj, expected):
|
|||
['"foo" like :p0', '"zax" glob :p1'],
|
||||
['2%2', '3*']
|
||||
),
|
||||
(
|
||||
{
|
||||
'foo__isnull': '1',
|
||||
'baz__isnull': '1',
|
||||
'bar__gt': '10'
|
||||
},
|
||||
['"bar" > :p0', '"baz" is null', '"foo" is null'],
|
||||
[10]
|
||||
),
|
||||
])
|
||||
def test_build_where(args, expected_where, expected_params):
|
||||
sql_bits, actual_params = utils.build_where_clauses(args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue