У меня есть поле списка в моей модели django для пользователей следующим образом: name = models.CharField() email = models.CharField() profiles = ListField()
I am using mongo as storage database with help of django_mongodb_engine. For one user, model object could be like
{name: 'Alice', email: 'abc', profiles: ['Read']}For another user it could be:
{name: 'John', email: 'xyz', profiles: ['Read', 'Write']}
I want to search for users which are assigned Read profile to them. In mongo db shell it can be performed simply by adding in query
{'profiles': 'Read'}. Can we perform search like that via django querysets ? When I tried, it gave me an exception "list indices must be integers, not str". Please guide me in this regards. Thanks