- Timestamp:
- 06/19/06 23:14:02 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r2938 r2950 397 397 description = self.databaseToUserCharset(base64.decodestring(description)) 398 398 user.Payments.append((date, float(amount), description)) 399 user.Exists = 1399 user.Exists = True 400 400 return user 401 401 … … 417 417 group.AccountBalance += member.AccountBalance 418 418 group.LifeTimePaid += member.LifeTimePaid 419 group.Exists = 1419 group.Exists = True 420 420 return group 421 421 … … 444 444 printer.uniqueMember = fields.get("uniqueMember", []) 445 445 printer.Description = self.databaseToUserCharset(fields.get("description", [""])[0]) 446 printer.Exists = 1446 printer.Exists = True 447 447 return printer 448 448 … … 489 489 else : 490 490 userpquota.MaxJobSize = int(userpquota.MaxJobSize[0]) 491 userpquota.Exists = 1491 userpquota.Exists = True 492 492 return userpquota 493 493 … … 547 547 grouppquota.PageCounter += int(userpquota[1].get("pykotaPageCounter", [0])[0] or 0) 548 548 grouppquota.LifePageCounter += int(userpquota[1].get("pykotaLifePageCounter", [0])[0] or 0) 549 grouppquota.Exists = 1549 grouppquota.Exists = True 550 550 return grouppquota 551 551 … … 622 622 mxtime = DateTime.strptime(date[:14], "%Y%m%d%H%M%S").localtime() 623 623 lastjob.JobDate = mxtime.strftime("%Y%m%d %H:%M:%S") 624 lastjob.Exists = 1624 lastjob.Exists = True 625 625 return lastjob 626 626 … … 664 664 group.AccountBalance += member.AccountBalance 665 665 group.LifeTimePaid += member.LifeTimePaid 666 group.Exists = 1666 group.Exists = True 667 667 self.cacheEntry("GROUPS", group.Name, group) 668 668 groups.append(group) … … 715 715 printer.uniqueMember = fields.get("uniqueMember", []) 716 716 printer.Description = self.databaseToUserCharset(fields.get("description", [""])[0]) 717 printer.Exists = 1717 printer.Exists = True 718 718 printers.append(printer) 719 719 self.cacheEntry("PRINTERS", printer.Name, printer) … … 780 780 description = self.databaseToUserCharset(base64.decodestring(description)) 781 781 user.Payments.append((date, float(amount), description)) 782 user.Exists = 1782 user.Exists = True 783 783 users.append(user) 784 784 self.cacheEntry("USERS", user.Name, user) … … 815 815 group.AccountBalance += member.AccountBalance 816 816 group.LifeTimePaid += member.LifeTimePaid 817 group.Exists = 1817 group.Exists = True 818 818 groups.append(group) 819 819 self.cacheEntry("GROUPS", group.Name, group) … … 859 859 else : 860 860 userpquota.DateLimit = userpquota.DateLimit[0] 861 userpquota.Exists = 1861 userpquota.Exists = True 862 862 usersandquotas.append((user, userpquota)) 863 863 self.cacheEntry("USERPQUOTAS", "%s@%s" % (user.Name, printer.Name), userpquota) … … 1383 1383 job.UserName = self.databaseToUserCharset(fields.get("pykotaUserName")[0]) 1384 1384 job.PrinterName = self.databaseToUserCharset(fields.get("pykotaPrinterName")[0]) 1385 job.Exists = 11385 job.Exists = True 1386 1386 jobs.append(job) 1387 1387 jobs.sort(lambda x, y : cmp(y.JobDate, x.JobDate)) … … 1712 1712 code.Balance = float(fields.get("pykotaBalance", [0.0])[0]) 1713 1713 code.Description = self.databaseToUserCharset(fields.get("description", [""])[0]) 1714 code.Exists = 11714 code.Exists = True 1715 1715 return code 1716 1716 … … 1765 1765 code.Balance = float(fields.get("pykotaBalance", [0.0])[0]) 1766 1766 code.Description = self.databaseToUserCharset(fields.get("description", [""])[0]) 1767 code.Exists = 11767 code.Exists = True 1768 1768 codes.append(code) 1769 1769 self.cacheEntry("BILLINGCODES", code.BillingCode, code) … … 1778 1778 return self.doModify(bcode.ident, fields) 1779 1779 1780 def storageUserFromRecord(self, username, record) : 1781 """Returns a StorageUser instance from a database record.""" 1782 user = StorageUser(self, username) 1783 user.Exists = True 1784 return user 1785 1786 def storageGroupFromRecord(self, groupname, record) : 1787 """Returns a StorageGroup instance from a database record.""" 1788 group = StorageGroup(self, groupname) 1789 group.Exists = True 1790 return group 1791 1792 def storagePrinterFromRecord(self, printername, record) : 1793 """Returns a StoragePrinter instance from a database record.""" 1794 printer = StoragePrinter(self, printername) 1795 printer.Exists = True 1796 return printer 1797 1798 def setJobAttributesFromRecord(self, job, record) : 1799 """Sets the attributes of a job from a database record.""" 1800 job.Exists = True 1801 1802 def storageJobFromRecord(self, record) : 1803 """Returns a StorageJob instance from a database record.""" 1804 job = StorageJob(self) 1805 self.setJobAttributesFromRecord(job, record) 1806 return job 1807 1808 def storageLastJobFromRecord(self, printer, record) : 1809 """Returns a StorageLastJob instance from a database record.""" 1810 lastjob = StorageLastJob(self, printer) 1811 self.setJobAttributesFromRecord(lastjob, record) 1812 return lastjob 1813 1814 def storageUserPQuotaFromRecord(self, user, printer, record) : 1815 """Returns a StorageUserPQuota instance from a database record.""" 1816 userpquota = StorageUserPQuota(self, user, printer) 1817 userpquota.Exists = True 1818 return userpquota 1819 1820 def storageGroupPQuotaFromRecord(self, group, printer, record) : 1821 """Returns a StorageGroupPQuota instance from a database record.""" 1822 grouppquota = StorageGroupPQuota(self, group, printer) 1823 grouppquota.Exists = True 1824 return grouppquota 1825 1826 def storageBillingCodeFromRecord(self, billingcode, record) : 1827 """Returns a StorageBillingCode instance from a database record.""" 1828 code = StorageBillingCode(self, billingcode) 1829 code.Exists = True 1830 return code