class ModelWithCountersWithCallback(models.Model): counter = ShardedCounterField(on_change=update_denormalized_counter) denormalized_counter = models.IntegerField(default=0) reset_count = models.IntegerField(default=0) class Meta: app_label = "djangae"
class ModelWithCounterWithManyShards(models.Model): # The DEFAULT_SHARD_COUNT is based on the max allowed in a Datastore transaction counter = ShardedCounterField(shard_count=DEFAULT_SHARD_COUNT + 5) class Meta: app_label = "djangae"
class ModelWithManyCounters(models.Model): counter1 = ShardedCounterField() counter2 = ShardedCounterField() class Meta: app_label = "djangae"
class ModelWithCounter(models.Model): counter = ShardedCounterField() class Meta: app_label = "djangae"