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

b/snf-astakos-app/astakos/im/models.py
62 62
from astakos.im import auth_providers as auth
63 63

  
64 64
import astakos.im.messages as astakos_messages
65
from snf_django.lib.db.managers import ForUpdateManager
66 65
from synnefo.lib.ordereddict import OrderedDict
67 66

  
68 67
from snf_django.lib.db.fields import intDecimalField
......
237 236
    uplimit = intDecimalField(default=0)
238 237
    allow_in_projects = models.BooleanField(default=True)
239 238

  
240
    objects = ForUpdateManager()
241

  
242 239
    def __str__(self):
243 240
        return self.name
244 241

  
......
455 452
                                          default=False, db_index=True)
456 453

  
457 454
    objects = AstakosUserManager()
458
    forupdate = ForUpdateManager()
459 455

  
460 456
    def __init__(self, *args, **kwargs):
461 457
        super(AstakosUser, self).__init__(*args, **kwargs)
......
1261 1257
    setting = models.CharField(max_length=255)
1262 1258
    value = models.IntegerField()
1263 1259

  
1264
    objects = ForUpdateManager()
1265

  
1266 1260
    class Meta:
1267 1261
        unique_together = ("user", "setting")
1268 1262

  
......
1272 1266

  
1273 1267
class Chain(models.Model):
1274 1268
    chain = models.AutoField(primary_key=True)
1275
    objects = ForUpdateManager()
1276 1269

  
1277 1270
    def __str__(self):
1278 1271
        return "%s" % (self.chain,)
......
1283 1276
    return c
1284 1277

  
1285 1278

  
1286
class ProjectApplicationManager(ForUpdateManager):
1279
class ProjectApplicationManager(models.Manager):
1287 1280

  
1288 1281
    def pending_per_project(self, projects):
1289 1282
        apps = self.filter(state=self.model.PENDING,
......
1527 1520
    return dict((v, k) for k, v in d.iteritems())
1528 1521

  
1529 1522

  
1530
class ProjectManager(ForUpdateManager):
1523
class ProjectManager(models.Manager):
1531 1524

  
1532 1525
    def all_with_pending(self, flt=None):
1533 1526
        flt = Q() if flt is None else flt
......
1802 1795

  
1803 1796

  
1804 1797
class ProjectLock(models.Model):
1805
    objects = ForUpdateManager()
1798
    pass
1806 1799

  
1807 1800

  
1808
class ProjectMembershipManager(ForUpdateManager):
1801
class ProjectMembershipManager(models.Manager):
1809 1802

  
1810 1803
    def any_accepted(self):
1811 1804
        q = self.model.Q_ACCEPTED_STATES

Also available in: Unified diff