Skip to content

Commit

Permalink
adjusted views
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelnferreira committed Nov 22, 2013
1 parent 1db4cea commit 20d28bf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions deliveryservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class GetUpdateUserRequest(messages.Message):
avg_price = messages.StringField(2)
vehicle = messages.StringField(3)
social_id = messages.StringField(4)
photo = messages.StringField(5)

class DeliveryService(remote.Service):
@remote.method(GetDeliveriesRequest, Deliveries)
Expand Down Expand Up @@ -128,6 +129,7 @@ def update_user(self, request):
app_user.last_status = 'Aguardando'
app_user.avg_price = request.avg_price
app_user.social_id = request.social_id
app_user.photo = request.photo

app_user.put()

Expand Down
1 change: 1 addition & 0 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class AppUser(db.Model):
social_id = db.StringProperty()
name = db.StringProperty()
phone = db.StringProperty()
photo = db.StringProperty()

class DeliverFee(db.Model):
source_address = db.StringProperty()
Expand Down
1 change: 1 addition & 0 deletions urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
(r'^app/listDeliveries$', 'views.listDeliveries'),
(r'^app/listOffers', 'views.listOffers'),
(r'^app/confirmOffer', 'views.confirmOffer'),
(r'^app/deliverCoordinates', 'views.deliverCoordinates'),
#(r'^admin/cameras$', 'views.listCam'),
#(r'^admin/camera/editar/(\d+)$', 'views.editCamera'),
#(r'^admin/camera/editar$', 'views.editCamera'),
Expand Down
4 changes: 2 additions & 2 deletions views.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ def deliverCoordinates(request):
deliver_id)

#ok, here we need to find the DeliveryOffer that is currently in progress, after the confirmation
q = db.GqlQuery("SELECT * FROM DeliverOffer WHERE deliver_fee = :1 AND state = 'Aceito' ")
q = db.GqlQuery("SELECT * FROM DeliverOffer WHERE deliver_fee = :1 AND state = 'Aceito' ", deliver)
offer = q.get()

return HttpResponse("{ }", content_type="application/jason")
return HttpResponse("{ 'src_lat' : %s, 'src_lgn': %s, 'des_lat' : %s, 'des_lgn' : %s, 'drv_lat' : %s, 'drv_lgn' : %s }" % ( deliver.source_lat, deliver.source_lng, deliver.dest_lat, deliver.dest_lng, offer.app_user.last_lat, offer.app_user.last_lng ), content_type="application/json")

def create_offer_query(deliver):
return db.GqlQuery("SELECT * "
Expand Down

0 comments on commit 20d28bf

Please sign in to comment.