The timeout argument is optional and defaults to the timeout argument of the appropriate backend in the CACHES setting (explained above). It’s the number of seconds the value should be stored in the cache.
Python compatibility¶
Django 2.2 supports Python 3.5, 3.6, and 3.7. We highly recommend and only officially support the latest release of each series.
item = 75648
que =[{'user': {85555: {'search': 1, 'sex': 1}}},{'user': {75648: {'search': 2, 'sex': 2}}}, {'user': {85587: {'search': 1, 'sex': 1}}}]
new_que = [q for q in que if item not in q['user'].keys()]
new_que
Out[5]:
[{'user': {85555: {'search': 1, 'sex': 1}}},
{'user': {85587: {'search': 1, 'sex': 1}}}]
que =[
{'user': 85555, 'search': 1, 'sex': 1},
...
]