Re: Django MongoEngine rest api app post request.POST.get('id')

2016-09-28 Thread Peter of the Norse
Are you doing request.POST.get(’taxi_id’) here? Because that will return a string. And in that case, id would be each letter in the actual ID. Try switching it to request.POST.getlist(’taxi_id’). > On Sep 27, 2016, at 9:43 AM, samer sarker wrote: > > for id in taxi_id: > taxi = Tax

Re: Django MongoEngine rest api app post request.POST.get('id')

2016-09-28 Thread Armando Licurgo
observ this: .objects(id=id). Armando Licurgo 2016-09-27 12:43 GMT-03:00 samer sarker : > for id in taxi_id: > taxi = TaxiMaster.objects(id=id).first() > > temp = BookedTaxi( > taxi_id=id, > driver_id=taxi.user_id, > is_seen=0, >

Django MongoEngine rest api app post request.POST.get('id')

2016-09-27 Thread samer sarker
for id in taxi_id: taxi = TaxiMaster.objects(id=id).first() temp = BookedTaxi( taxi_id=id, driver_id=taxi.user_id, is_seen=0, is_accepted=0, is_rejected=0 ) ValidationError at /action u'5' is not a valid Obje