python - Django rest framework: correctly handle incoming array of model ids -
i have question rest design in general , best way implement solution in django rest framework. here situation:
say have app keeping track of albums user likes. in browser, user sees list of albums , each 1 has check box next it. checking box means album. @ bottom of page submit button.
i want submit button initiate ajax request sends tp api endpoint list of ids (as in, djano model ids) of albums liked user.
my question is, standard approach doing sort of thing (i new web stuff , rest in particular). in other words, there better way handle transmission of these data send array of ids this? corollary, if alright approach, how 1 implement in django rest framework in way consistent intended methodology.
i keeping question little vague (not presenting code album serializer, example) intentionally because looking learn fundamentals, not debug particular piece of code.
thanks lot in advance!
consider upvote button left. when click it, request may sent stackoverflow.com/question/12345/upvote. creates "action resource" on db, later can go user profile , check out list of actions took.
you can consider doing same thing application. may better user experience have immediate action taken so, or "batch" request gmail's check boxes.
Comments
Post a Comment