MyModel.objects.filter(
Q(title__iregex=r'.{10,}.*') |
Q(title__iregex=r'.*[0-9].*') |
Q(title__iregex=r'\s+')
)
我收到了titles are longer than 10
或其titles contain at least one number
的所有对象。
但Q(title__iregex=r'\s+')
失败,应返回标题至少包含一个空格的对象。我究竟做错了什么?
我试过了:
r'[\\s+]'
r'.*[\\s+].*'
r'\\s+'
r'[:space:]'
没有成功的迹象。
我正在使用MySQL btw
答案 0 :(得分:3)
#second.py
from subprocess import Popen, PIPE
def process_numbers():
p = Popen(["first.py", "argument"], stdout=PIPE, stderr=PIPE)
out, err = p.communicate()
# the out variable now contains the standard output of the first script
# do something to process the numbers