Created
August 10, 2015 18:59
-
-
Save prrraveen/9fc23f0d2ab5538828d4 to your computer and use it in GitHub Desktop.
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
from django.http import HttpResponse, HttpResponseBadRequest | |
from django.views.decorators.csrf import csrf_exempt | |
from django.views.decorators.http import require_GET, require_POST | |
import pdb | |
import json | |
def edit(request): | |
brand ={ | |
'colors' :[ | |
{ 'id' : 1 , 'value' : 'RED' }, | |
{ 'id' : 2 , 'value' : 'WHITE' }, | |
{ 'id' : 3 , 'value' : 'BLACK' }, | |
{ 'id' : 4 , 'value' : 'YELLOR' } | |
], | |
'flyrobe_sizes': [ | |
{'id' : 36 , 'value' : 'foo Size'}, | |
{'id' : 35 , 'value' : 'Bar size'}, | |
{'id' : 7 , 'value' : 'falana size'}, | |
{'id' : 1 , 'value' : 'dikda size'}, | |
], | |
} | |
opt = { | |
'brand' : brand | |
} | |
item = { | |
'id' : 2, | |
'name': 'FOO', | |
'colors': [3, 4], | |
'flyrobe_sizes': ['36', "35"] | |
} | |
result = { | |
'opt': opt, | |
'item': item | |
} | |
return HttpResponse(json.dumps(result), content_type='application/json') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment