lab-sheet05 ECS639U WebProgramming Lab5 TOPICS: AJAX, JQUERY, JSON RESPONSES TASK DevelopabasicAjaxfrontendandDjangobackendforasimplewebAPI.Yourappmusthave...

no referencing needed. its a coding assignment not essay
question file is attached


lab-sheet05 ECS639U WebProgramming Lab5 TOPICS: AJAX, JQUERY, JSON RESPONSES TASK DevelopabasicAjaxfrontendandDjangobackendforasimplewebAPI.Yourappmusthave onemodelwithatleastthree:ieldsofdifferenttypes.Forinstance,youcouldhaveaBook modelwithBields:title(CharField),review(TextField)andprice(DecimalField). OntheDjangobackendyourapplicationshouldrespondtothefourrequesttypes(GET,POST, PUTandDELETE).Youcanusethe“method”BieldoftherequestobjectstoBindoutwhichtype ofrequestisbeingmade(oruseclass-basedviews).Foreachrequesttypeyoushouldrespond appropriately.AlldatabeingreturnedtotheclientthisshouldbedoneusingDjango’s JsonReponseobject,whichtakesaPythondictionaryasinput. Onthefrontendoneshouldbeableto • seethelistofallelementsinyourmodel • clickononeoftheelementsofthelistandseealldetailsofthatelement(GET) • addanewelementtothelist(POST) • updatethedetailsofoneoftheelements(PUT) • deleteaelement(DELETE) Itisuptoyoutodecidehowthesewillbelaidoutonthebrowser.Anyrequestfromtheclient totheservershouldbedoneviaAjaxrequestsusingthejQuerylibrary.SoaftertheBirstpage load,thereshouldbenofurtherpagerefreshes. MARKING CRITERIA Achieved Mark ModeldeBinedwiththreedifferentBieldswithdistincttypes,listofitemsis shownwhenBirstvisitingthepage,oruponanAjaxGETrequest 20% Asabove+FrontendGET(tofetchitemsorsingleitemdetails)andPOST(to addnewitem)ajaxrequestsbeingused,andthesearecorrectlydealtwithby correspondingviewfunctions/class 50% Asabove+FrontendPUT(toupdateanitemdetail)andDELETE(toremove anitem)ajaxrequestsbeingused,andthesearecorrectlydealtwithby correspondingviewfunctions/class 70% Alloftheabove,butfortwodifferentmodelswithaone-to-manyormany-to- manyrelationshipbetweenthem 100% DrPauloOliva QueenMaryUniversityofLondon Thisisthesecondcomponentofyourindividualcoursework.Itisworth10%ofyour overallmark.AswiththeBirsttask,askademonstratorormyselftocheckyoursolutionby thegivendeadline(11amonThu7November).Youcanworkonthisduringthenexttwo labs. The“Book”examplesaboveisjusttohelpyouunderstandtheassignment,andyoumust NOTusethisexampleforyourcoursework,pleasetrytocomeupwithyourownmodel withdifferentBields. https://docs.djangoproject.com/en/stable/topics/class-based-views/ https://docs.djangoproject.com/en/stable/ref/request-response/#jsonresponse-objects
Nov 03, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here