Index: pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- pykota/trunk/pykota/storages/ldapstorage.py (revision 2938)
+++ pykota/trunk/pykota/storages/ldapstorage.py (revision 2950)
@@ -397,5 +397,5 @@
                         description = self.databaseToUserCharset(base64.decodestring(description))
                     user.Payments.append((date, float(amount), description))
-            user.Exists = 1
+            user.Exists = True
         return user
        
@@ -417,5 +417,5 @@
                     group.AccountBalance += member.AccountBalance
                     group.LifeTimePaid += member.LifeTimePaid
-            group.Exists = 1
+            group.Exists = True
         return group
        
@@ -444,5 +444,5 @@
             printer.uniqueMember = fields.get("uniqueMember", [])
             printer.Description = self.databaseToUserCharset(fields.get("description", [""])[0]) 
-            printer.Exists = 1
+            printer.Exists = True
         return printer    
         
@@ -489,5 +489,5 @@
                     else :    
                         userpquota.MaxJobSize = int(userpquota.MaxJobSize[0])
-                userpquota.Exists = 1
+                userpquota.Exists = True
         return userpquota
         
@@ -547,5 +547,5 @@
                         grouppquota.PageCounter += int(userpquota[1].get("pykotaPageCounter", [0])[0] or 0)
                         grouppquota.LifePageCounter += int(userpquota[1].get("pykotaLifePageCounter", [0])[0] or 0)
-                grouppquota.Exists = 1
+                grouppquota.Exists = True
         return grouppquota
         
@@ -622,5 +622,5 @@
                 mxtime = DateTime.strptime(date[:14], "%Y%m%d%H%M%S").localtime()
                 lastjob.JobDate = mxtime.strftime("%Y%m%d %H:%M:%S")
-                lastjob.Exists = 1
+                lastjob.Exists = True
         return lastjob
         
@@ -664,5 +664,5 @@
                             group.AccountBalance += member.AccountBalance
                             group.LifeTimePaid += member.LifeTimePaid
-                    group.Exists = 1
+                    group.Exists = True
                     self.cacheEntry("GROUPS", group.Name, group)
                 groups.append(group)
@@ -715,5 +715,5 @@
                     printer.uniqueMember = fields.get("uniqueMember", [])
                     printer.Description = self.databaseToUserCharset(fields.get("description", [""])[0]) 
-                    printer.Exists = 1
+                    printer.Exists = True
                     printers.append(printer)
                     self.cacheEntry("PRINTERS", printer.Name, printer)
@@ -780,5 +780,5 @@
                                 description = self.databaseToUserCharset(base64.decodestring(description))
                             user.Payments.append((date, float(amount), description))
-                    user.Exists = 1
+                    user.Exists = True
                     users.append(user)
                     self.cacheEntry("USERS", user.Name, user)
@@ -815,5 +815,5 @@
                             group.AccountBalance += member.AccountBalance
                             group.LifeTimePaid += member.LifeTimePaid
-                    group.Exists = 1
+                    group.Exists = True
                     groups.append(group)
                     self.cacheEntry("GROUPS", group.Name, group)
@@ -859,5 +859,5 @@
                     else :    
                         userpquota.DateLimit = userpquota.DateLimit[0]
-                userpquota.Exists = 1
+                userpquota.Exists = True
                 usersandquotas.append((user, userpquota))
                 self.cacheEntry("USERPQUOTAS", "%s@%s" % (user.Name, printer.Name), userpquota)
@@ -1383,5 +1383,5 @@
                     job.UserName = self.databaseToUserCharset(fields.get("pykotaUserName")[0])
                     job.PrinterName = self.databaseToUserCharset(fields.get("pykotaPrinterName")[0])
-                    job.Exists = 1
+                    job.Exists = True
                     jobs.append(job)
             jobs.sort(lambda x, y : cmp(y.JobDate, x.JobDate))        
@@ -1712,5 +1712,5 @@
             code.Balance = float(fields.get("pykotaBalance", [0.0])[0])
             code.Description = self.databaseToUserCharset(fields.get("description", [""])[0]) 
-            code.Exists = 1
+            code.Exists = True
         return code    
         
@@ -1765,5 +1765,5 @@
                     code.Balance = float(fields.get("pykotaBalance", [0.0])[0])
                     code.Description = self.databaseToUserCharset(fields.get("description", [""])[0]) 
-                    code.Exists = 1
+                    code.Exists = True
                     codes.append(code)
                     self.cacheEntry("BILLINGCODES", code.BillingCode, code)
@@ -1778,2 +1778,53 @@
         return self.doModify(bcode.ident, fields)         
 
+    def storageUserFromRecord(self, username, record) :
+        """Returns a StorageUser instance from a database record."""
+        user = StorageUser(self, username)
+        user.Exists = True
+        return user
+        
+    def storageGroupFromRecord(self, groupname, record) :
+        """Returns a StorageGroup instance from a database record."""
+        group = StorageGroup(self, groupname)
+        group.Exists = True
+        return group
+        
+    def storagePrinterFromRecord(self, printername, record) :
+        """Returns a StoragePrinter instance from a database record."""
+        printer = StoragePrinter(self, printername)
+        printer.Exists = True
+        return printer
+        
+    def setJobAttributesFromRecord(self, job, record) :    
+        """Sets the attributes of a job from a database record."""
+        job.Exists = True
+        
+    def storageJobFromRecord(self, record) :
+        """Returns a StorageJob instance from a database record."""
+        job = StorageJob(self)
+        self.setJobAttributesFromRecord(job, record)
+        return job
+        
+    def storageLastJobFromRecord(self, printer, record) :
+        """Returns a StorageLastJob instance from a database record."""
+        lastjob = StorageLastJob(self, printer)
+        self.setJobAttributesFromRecord(lastjob, record)
+        return lastjob
+        
+    def storageUserPQuotaFromRecord(self, user, printer, record) :
+        """Returns a StorageUserPQuota instance from a database record."""
+        userpquota = StorageUserPQuota(self, user, printer)
+        userpquota.Exists = True
+        return userpquota
+        
+    def storageGroupPQuotaFromRecord(self, group, printer, record) :
+        """Returns a StorageGroupPQuota instance from a database record."""
+        grouppquota = StorageGroupPQuota(self, group, printer)
+        grouppquota.Exists = True
+        return grouppquota
+        
+    def storageBillingCodeFromRecord(self, billingcode, record) :
+        """Returns a StorageBillingCode instance from a database record."""
+        code = StorageBillingCode(self, billingcode)
+        code.Exists = True
+        return code
