6347 remove counters dict

This commit is contained in:
Arthur 2023-07-19 15:00:39 +07:00
parent 58f737c6a3
commit b98fecd188

View File

@ -5,8 +5,6 @@ from functools import partial
from .fields import CounterCacheField from .fields import CounterCacheField
from .mixins import TrackingModelMixin from .mixins import TrackingModelMixin
counters = {}
def post_save_receiver_counter(counter_instance, sender, instance, created, **kwargs): def post_save_receiver_counter(counter_instance, sender, instance, created, **kwargs):
if created: if created:
@ -69,8 +67,6 @@ class Counter:
dispatch_uid=f'{counted_name}_post_delete', dispatch_uid=f'{counted_name}_post_delete',
) )
counters[counted_name] = self
def parent_id(self, child): def parent_id(self, child):
return getattr(child, self.foreign_key_field.attname) return getattr(child, self.foreign_key_field.attname)