What about using pythons regular expression module (re) ? Example,
if re.search("\d", "Search query 2 search"):
# Do this.
else:
# Do this instead.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users
Hey guys,
In a view, is there a way to check if a search/querystring has a
number in it?
If number in string:
do this
otherwise:
do this instead ...
Any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Grou
2 matches
Mail list logo