divanov11 / mumbleapi

Backend/API for the Mumble.dev, an open source social media application.
Apache License 2.0
199 stars 122 forks source link

setting comment count as a serializerMethodField #173

Closed PraveenMalethia closed 3 years ago

PraveenMalethia commented 3 years ago

I will add the comment count as a field in the serializer and get the count in the method and comment count from models will be removed in order to save space in DB! in method, the function will fetch the mumble who has the parent id attached!

PraveenMalethia commented 3 years ago

also, we can get rid of signals and reduce code! signals which are for updating comment count! this will also improve the readability of code! solving the issue https://github.com/divanov11/Mumble/issues/443

divanov11 commented 3 years ago

Do you think it will slow down load time? I added that as a hard coded value so we dont have to perform the calculation on each request...