mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
9 lines
197 B
Python
9 lines
197 B
Python
def filter_by_pk(filt, query):
|
|
# try and parse an int
|
|
try:
|
|
val = int(query)
|
|
filt = filt | Q(pk=val)
|
|
except: # noqa
|
|
# not an integer
|
|
pass
|
|
return filt |