So this is how my models look like. Class A is having an EmbeddedDocumentListField of SlotTime
class SlotTime(EmbeddedDocument):
# this is having minutes like 780 for 1pm.
start_time = IntField(required=True)
end_time = IntField(required=True)
class A(Document):
name = StringField(primary_key=True)
slot_hours = EmbeddedDocumentListField(SlotTime)
SlotTime has a list of objects with start and end time value.
[<SlotTime: SlotTime object>,<SlotTime: SlotTime object>]
and now I want to make a query that will return me the results that have start_time greater that to a given value. want a something similar to this query-
A.objects.get(name__exact='xyz').slot_hours.filter(start_time__gte=780)
tried this but this is returning all the value.
A.objects.filter(name__exact='xyz',slot_hours__start_time__gte=780)[0].slot_hours
Any idea, how to do this?
So this is how my models look like. Class A is having an EmbeddedDocumentListField of SlotTime
SlotTime has a list of objects with start and end time value.
[<SlotTime: SlotTime object>,<SlotTime: SlotTime object>]and now I want to make a query that will return me the results that have start_time greater that to a given value. want a something similar to this query-
A.objects.get(name__exact='xyz').slot_hours.filter(start_time__gte=780)tried this but this is returning all the value.
A.objects.filter(name__exact='xyz',slot_hours__start_time__gte=780)[0].slot_hoursAny idea, how to do this?