jwjacobson / jazztunes

a jazz repertoire management app
https://jazztunes.org
GNU General Public License v3.0
3 stars 1 forks source link

if user answers "no" suggest another tune #117

Closed bbelderbos closed 7 months ago

bbelderbos commented 8 months ago
    if request.method == "POST":
        if "yes" in request.POST:
            tune_to_play = suggested_tune
            tune_to_play.last_played = timezone.now()
            tune_to_play.save()
            messages.success(request, f"Played {tune_to_play.tune.title}!")
        elif "no" in request.POST:
            # TODO: suggest another tune
            messages.info(request, f"Please search again")
jwjacobson commented 8 months ago

This has proven to be kind of a beast.

Here is a sketch of how it should work but the implementation has eluded me.

play_diagram

jwjacobson commented 8 months ago

To be specific, the issue has been getting the playform to receive the queryset, whether as an actual queryset or simply as a list if IDs.

bbelderbos commented 8 months ago

Related to this right? https://github.com/jwjacobson/jazz_repertoire/pull/122#pullrequestreview-1809001913 - I will check if there is an easier way ...