Index: pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- pykota/trunk/pykota/storages/ldapstorage.py (revision 3532)
+++ pykota/trunk/pykota/storages/ldapstorage.py (revision 3549)
@@ -447,5 +447,10 @@
             printer.PricePerJob = float(fields.get("pykotaPricePerJob", [0.0])[0])
             printer.PricePerPage = float(fields.get("pykotaPricePerPage", [0.0])[0])
-            printer.MaxJobSize = int(fields.get("pykotaMaxJobSize", [0])[0])
+            printer.MaxJobSize = fields.get("pykotaMaxJobSize")
+            if printer.MaxJobSize is not None :
+                if printer.MaxJobSize[0].upper() == "NONE" :
+                    printer.MaxJobSize = None
+                else :
+                    printer.MaxJobSize = int(printer.MaxJobSize[0])
             printer.PassThrough = fields.get("pykotaPassThrough", [None])[0]
             if printer.PassThrough in (1, "1", "t", "true", "TRUE", "True") :
@@ -513,5 +518,5 @@
             result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaGroupName=%s)(pykotaPrinterName=%s))" % \
                                       (unicodeToDatabase(group.Name), unicodeToDatabase(printer.Name)), \
-                                      ["pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit", "pykotaMaxJobSize"], \
+                                      ["pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], \
                                       base=base)
             if result :
@@ -536,10 +541,4 @@
                     else :
                         grouppquota.DateLimit = grouppquota.DateLimit[0]
-                grouppquota.MaxJobSize = fields.get("pykotaMaxJobSize")
-                if grouppquota.MaxJobSize is not None :
-                    if grouppquota.MaxJobSize[0].upper() == "NONE" :
-                        grouppquota.MaxJobSize = None
-                    else :
-                        grouppquota.MaxJobSize = int(grouppquota.MaxJobSize[0])
                 grouppquota.PageCounter = 0
                 grouppquota.LifePageCounter = 0
@@ -712,5 +711,10 @@
                     printer.PricePerJob = float(fields.get("pykotaPricePerJob", [0.0])[0] or 0.0)
                     printer.PricePerPage = float(fields.get("pykotaPricePerPage", [0.0])[0] or 0.0)
-                    printer.MaxJobSize = int(fields.get("pykotaMaxJobSize", [0])[0])
+                    printer.MaxJobSize = fields.get("pykotaMaxJobSize")
+                    if printer.MaxJobSize is not None :
+                        if printer.MaxJobSize[0].upper() == "NONE" :
+                            printer.MaxJobSize = None
+                        else :
+                            printer.MaxJobSize = int(printer.MaxJobSize[0])
                     printer.PassThrough = fields.get("pykotaPassThrough", [None])[0]
                     if printer.PassThrough in (1, "1", "t", "true", "TRUE", "True") :
@@ -892,5 +896,5 @@
                    "pykotaPrinterName" : printername,
                    "pykotaPassThrough" : (printer.PassThrough and "t") or "f",
-                   "pykotaMaxJobSize" : str(printer.MaxJobSize or 0),
+                   "pykotaMaxJobSize" : str(printer.MaxJobSize),
                    "description" : unicodeToDatabase(printer.Description or ""),
                    "pykotaPricePerPage" : str(printer.PricePerPage or 0.0),
@@ -1070,5 +1074,5 @@
                    "pykotaLifePageCounter" : str(upq.LifePageCounter or 0),
                    "pykotaWarnCount" : str(upq.WarnCount or 0),
-                   "pykotaMaxJobSize" : str(upq.MaxJobSize or 0),
+                   "pykotaMaxJobSize" : str(upq.MaxJobSize),
                  }
         if self.info["userquotabase"].lower() == "user" :
@@ -1106,5 +1110,5 @@
         fields = {
                    "pykotaPassThrough" : (printer.PassThrough and "t") or "f",
-                   "pykotaMaxJobSize" : str(printer.MaxJobSize or 0),
+                   "pykotaMaxJobSize" : str(printer.MaxJobSize),
                    "description" : unicodeToDatabase(printer.Description or ""),
                    "pykotaPricePerPage" : str(printer.PricePerPage or 0.0),
@@ -1251,5 +1255,5 @@
                    "pykotaPageCounter" : str(userpquota.PageCounter or 0),
                    "pykotaLifePageCounter" : str(userpquota.LifePageCounter or 0),
-                   "pykotaMaxJobSize" : str(userpquota.MaxJobSize or 0),
+                   "pykotaMaxJobSize" : str(userpquota.MaxJobSize),
                  }
         self.doModify(userpquota.ident, fields)
@@ -1275,5 +1279,4 @@
                    "pykotaHardLimit" : str(grouppquota.HardLimit),
                    "pykotaDateLimit" : str(grouppquota.DateLimit),
-                   "pykotaMaxJobSize" : str(grouppquota.MaxJobSize or 0),
                  }
         self.doModify(grouppquota.ident, fields)
@@ -1680,10 +1683,10 @@
         entries = [p for p in [self.getPrinter(name) for name in self.getAllPrintersNames(pname)] if p.Exists]
         if entries :
-            fields = ("username", "printername", "dn", "userdn", "printerdn", "lifepagecounter", "pagecounter", "softlimit", "hardlimit", "datelimit")
+            fields = ("username", "printername", "dn", "userdn", "printerdn", "lifepagecounter", "pagecounter", "softlimit", "hardlimit", "datelimit", "maxjobsize")
             result = []
             uname = extractonly.get("username")
             for entry in entries :
                 for (user, userpquota) in self.getPrinterUsersAndQuotas(entry, names=[uname or "*"]) :
-                    result.append((user.Name, entry.Name, userpquota.ident, user.ident, entry.ident, userpquota.LifePageCounter, userpquota.PageCounter, userpquota.SoftLimit, userpquota.HardLimit, userpquota.DateLimit))
+                    result.append((user.Name, entry.Name, userpquota.ident, user.ident, entry.ident, userpquota.LifePageCounter, userpquota.PageCounter, userpquota.SoftLimit, userpquota.HardLimit, userpquota.DateLimit, userpquota.MaxJobSize))
             return [fields] + self.sortRecords(fields, result, ["+userdn"], ordering)
 
