This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func postImages(_ orderId: String, images: [UIImage]) { | |
var tmpImages = images | |
Alamofire.upload(multipartFormData: { | |
multipartFormData in | |
multipartFormData.append(orderId.data(using: String.Encoding.utf8, allowLossyConversion: false)!, withName: "order") | |
multipartFormData.append(UIImageJPEGRepresentation(images[0], 95)!, withName: "image", fileName: orderId + "_picture.jpg", mimeType: "image/jpg") | |
}, to: UserOrderUploadImageURL, encodingCompletion: { | |
encodingResult in | |
switch encodingResult { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TypeError at /api/v1/users/3/orders | |
Got a `TypeError` when calling `Order.objects.create()`. This may be because you have a writable field on the serializer class that is not a valid argument to `Order.objects.create()`. You may need to make the field read-only, or override the OrderSerializer.create() method to handle this correctly. | |
Original exception was: | |
Traceback (most recent call last): | |
File \"/usr/local/lib/python2.7/site-packages/rest_framework/serializers.py\", line 902, in create | |
instance = ModelClass.objects.create(**validated_data) | |
File \"/usr/local/lib/python2.7/site-packages/django/db/models/manager.py\", line 85, in manager_method | |
return getattr(self.get_queryset(), name)(*args, **kwargs) | |
File \"/usr/local/lib/python2.7/site-packages/django/db/models/query.py\", line 399, in create | |
obj.save(force_insert=True, using=self.db) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static let BodyType: [String: String] = [ | |
"sedan": "Седан", | |
"touring": "Универсал", | |
"hatchback": "Хетчбэк", | |
"compartment": "Купе", | |
"limousine": "Лимузин", | |
"minivan": "Минивэн", | |
"hardtop": "Хардтоп", | |
"town_car": "Таун-кар", | |
"combi": "Комби", |