Revision c7e03d20 snf-astakos-app/astakos/quotaholder_app/models.py

b/snf-astakos-app/astakos/quotaholder_app/models.py
35 35

  
36 36
from django.db.models import (Model, BigIntegerField, CharField, DateTimeField,
37 37
                              ForeignKey, AutoField)
38
from snf_django.lib.db.managers import ForUpdateManager
39 38

  
40 39

  
41 40
class Holding(Model):
......
48 47
    usage_min = intDecimalField(default=0)
49 48
    usage_max = intDecimalField(default=0)
50 49

  
51
    objects = ForUpdateManager()
52

  
53 50
    class Meta:
54 51
        unique_together = (('holder', 'source', 'resource'),)
55 52

  
......
61 58
    clientkey = CharField(max_length=4096, null=False)
62 59
    issue_datetime = DateTimeField()
63 60

  
64
    objects = ForUpdateManager()
65

  
66 61

  
67 62
class Provision(Model):
68 63

  
......
75 70

  
76 71
    quantity = intDecimalField()
77 72

  
78
    objects = ForUpdateManager()
79

  
80 73
    def todict(self):
81 74
        return {'holder':   self.holder,
82 75
                'source':   self.source,
......
102 95
    usage_max = intDecimalField()
103 96
    delta_quantity = intDecimalField()
104 97
    reason = CharField(max_length=4096)
105

  
106
    objects = ForUpdateManager()

Also available in: Unified diff