Qu'est-ce que ce code add_to_serializer dans tous ces plugins

If possible, can you please share the link of the plugin that you were working on at that time?

1 « J'aime »

Thanks for the great explanations. Am I right to assume that it would be possible to use add_to_serializer, something like op_likes? I’m not sure why this happens, but I can only have access to the op_likes_count when I order by it (as in order=op_likes), but I wanted to have such numbers without having to order by it.

Is there also a way to use it from JavaScript? I’m currently looking at `showOpLikes` doesn't work right away, but after clicking back and forth - #6 by pfaffman which was closed.

No, you can’t change an API from a client :slight_smile:

1 « J'aime »

This should absolutely not be the default. Not all user custom fields should be displayed to the user (e.g. see Staff Notes).

5 « J'aime »

Je me demande si « ajouter au sérialiseur » pourrait être une case à cocher lors de la création d’un champ utilisateur personnalisé dans l’interface utilisateur. Et ensuite, la PR pourrait vérifier si le champ utilisateur personnalisé a l’option « ajouter au sérialiseur » et, si c’est le cas, l’ajouter.

4 « J'aime »

5 publications ont été déplacées vers un nouveau sujet : Ajouter au sérialiseur d’utilisateur ne fonctionne pas pour l’objet utilisateur actuel