示例#1
0
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"
示例#2
0
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"
示例#3
0
class ModelWithManyCounters(models.Model):
    counter1 = ShardedCounterField()
    counter2 = ShardedCounterField()

    class Meta:
        app_label = "djangae"
示例#4
0
class ModelWithCounter(models.Model):
    counter = ShardedCounterField()

    class Meta:
        app_label = "djangae"