Hi ,

can anyone tell the output code for below queues as soon as possible 
please......

Given source data and destination data (in json format), write a function 
which will validate whether
source data is same as destination data and highlight the differences.
Bonus: If you can validate order of data in list type values as well.

E.g. below source_data and destination data are not same (highlighted 
difference in bold )

source_data = {
"name": "Kaleigh",
"username": "Kaleigh60",
"email": "kaleigh6...@gmail.com",
"address": {
"street": "Myah Course",
"suite": "Apt. 657",
"city": "Boyerberg",
"zipcode": "66413-8920",
"geo": {
"lat": "-44.6203",
"lng": "16.7454"
}
},
"website": "megane.biz",
"friends": [
{
"name": "Little-Reinger",
"catchPhrase": "Enhanced regional emulation"
},
{
"name": "Big-Reinger",
"catchPhrase": "emulation"
}
],
"Numbers": [
1, 2, 3, 4
]
}

destination_data = {
"name": "Kaligh",
"username": "Kaleigh60",
"email": "kaleigh6...@gmail.com",
"address": {
"street": "Gold Course",
"suite": "Apt. 657",
"city": "Boyerberg",
"zipcode": "66413-8920",
"geo": {
"lat": "-44.6203",
"lng": "16.7454"
}
},
"website": "megane.biz",
"friends": [
{
"name": "Reinger",
"catchPhrase": "Enhanced regional emulation"
},
{
"name": "Big-Reinger",
"catchPhrase": "emulation"
}
],
"Numbers": [
4, 2, 1, 5
]
}


E.g 2. Following data are same

source_data = {
"name": "Kaleigh",
"username": "Kaleigh60",
"email": "kaleigh6...@gmail.com",
"address": {
"street": "Myah Course",
"suite": "Apt. 657",
"city": "Boyerberg",
"zipcode": "66413-8920",
"geo": {
"lat": "-44.6203",
"lng": "16.7454"
}
}
}

destination_data = {
"name": "Kaleigh",
"address": {
"street": "Myah Course",
"suite": "Apt. 657",
"city": "Boyerberg",
"zipcode": "66413-8920",
"geo": {
"lat": "-44.6203",
"lng": "16.7454"
}
},
"username": "Kaleigh60",
"email": "kaleigh6...@gmail.com",
}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/385693a8-c54b-4f97-82c4-5e3f90c513d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to