(cls, user, episodes=None)
return dict(states.values_list("episode", "action"))
The state of the users episode as a {episode: state} dict
The state of the users episode as a {episode: state} dict
The state of the users episode as a { episode : state } dict
def dict_for_user(cls, user, episodes=None):
        """The state of the users episode as a {episode: state} dict"""
        states = cls.objects.filter(user=user)

        if episodes is not None:
            states = states.filter(episode__in=episodes)

        return dict(states.values_list("episode", "action"))
def dict_for_user ( cls , user , episodes = None ) : states = cls . objects . filter ( user = user ) if episodes is not None : states = states . filter ( episode__in = episodes ) return dict ( states . values_list ( "episode" , "action" ) )