-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hot fix : améliorer la perf de la page "mes cantines" #3955
Conversation
"central_kitchen_diagnostics", # can return a TD status instead of diagnostics | ||
) | ||
fields = my_fields | ||
read_only_fields = my_fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On ne peut pas directement écrire read_only_fields = (... ) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comme
fields = ("id", "name",...)
read_only_fields = ("id", "name",...)
?
Oui on peut, je n'aime pas la repetition
|
||
class Meta: | ||
model = Canteen | ||
my_fields = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my_fields = ( | |
read_only_fields = ( | |
"id", | |
"name", | |
"city", | |
"city_insee_code", | |
"postal_code", | |
"sectors", | |
"daily_meal_count", | |
"yearly_meal_count", | |
"siret", | |
"management_type", | |
"production_type", | |
"department", | |
"region", | |
"publication_status", | |
"economic_model", | |
"is_central_cuisine", | |
"modification_date", | |
# the following can still be improved | |
"images", # can return the first image only | |
"diagnostics", | |
"central_kitchen_diagnostics", # can return a TD status instead of diagnostics | |
) |
Suite à une PR qui a ajouté quelques champs complèxes sur le
FullCanteenSerializer
, il y a un interêt d'avoir un nouveau endpoint pour la pagination des cantines. Sur staging je c'est bcp trop lente.Avant : 1.68s; après : 138 ms
idéalement on fera en deuxième temps une refacto des serializers et endpoints pour voir lesquels on pourrait merger, quoi on a qui est maintenant redondant #3956