Index: pykota/trunk/pykota/storages/sql.py
===================================================================
--- pykota/trunk/pykota/storages/sql.py (revision 3541)
+++ pykota/trunk/pykota/storages/sql.py (revision 3549)
@@ -62,5 +62,5 @@
         printer.PricePerJob = record.get("priceperjob") or 0.0
         printer.PricePerPage = record.get("priceperpage") or 0.0
-        printer.MaxJobSize = record.get("maxjobsize") or 0
+        printer.MaxJobSize = record.get("maxjobsize")
         printer.PassThrough = record.get("passthrough") or 0
         if printer.PassThrough in (1, "1", "t", "true", "TRUE", "True") :
@@ -119,4 +119,5 @@
         userpquota.HardLimit = record.get("hardlimit")
         userpquota.DateLimit = record.get("datelimit")
+        userpquota.MaxJobSize = record.get("maxjobsize")
         userpquota.WarnCount = record.get("warncount") or 0
         userpquota.Exists = True
@@ -243,5 +244,5 @@
             thefilter = "AND %s" % thefilter
         orderby = self.createOrderBy(["+grouppquota.id"], ordering)
-        result = self.doRawSearch("SELECT groups.groupname,printers.printername,grouppquota.*,coalesce(sum(pagecounter), 0) AS pagecounter,coalesce(sum(lifepagecounter), 0) AS lifepagecounter FROM groups,printers,grouppquota,userpquota WHERE groups.id=grouppquota.groupid AND printers.id=grouppquota.printerid AND userpquota.printerid=grouppquota.printerid AND userpquota.userid IN (SELECT userid FROM groupsmembers WHERE groupsmembers.groupid=grouppquota.groupid) %(thefilter)s GROUP BY grouppquota.id,grouppquota.groupid,grouppquota.printerid,grouppquota.softlimit,grouppquota.hardlimit,grouppquota.datelimit,grouppquota.maxjobsize,groups.groupname,printers.printername ORDER BY %(orderby)s" % locals())
+        result = self.doRawSearch("SELECT groups.groupname,printers.printername,grouppquota.*,coalesce(sum(pagecounter), 0) AS pagecounter,coalesce(sum(lifepagecounter), 0) AS lifepagecounter FROM groups,printers,grouppquota,userpquota WHERE groups.id=grouppquota.groupid AND printers.id=grouppquota.printerid AND userpquota.printerid=grouppquota.printerid AND userpquota.userid IN (SELECT userid FROM groupsmembers WHERE groupsmembers.groupid=grouppquota.groupid) %(thefilter)s GROUP BY grouppquota.id,grouppquota.groupid,grouppquota.printerid,grouppquota.softlimit,grouppquota.hardlimit,grouppquota.datelimit,groups.groupname,printers.printername ORDER BY %(orderby)s" % locals())
         return self.prepareRawResult(result)
 
@@ -560,5 +561,5 @@
                           % (self.doQuote(unicodeToDatabase(printer.Name)), \
                              self.doQuote((printer.PassThrough and "t") or "f"), \
-                             self.doQuote(printer.MaxJobSize or 0), \
+                             self.doQuote(printer.MaxJobSize), \
                              self.doQuote(unicodeToDatabase(printer.Description)), \
                              self.doQuote(printer.PricePerPage or 0.0), \
@@ -650,11 +651,10 @@
         if oldentry.Exists :
             return oldentry
-        self.doModify("INSERT INTO grouppquota (groupid, printerid, softlimit, hardlimit, datelimit, maxjobsize) VALUES (%s, %s, %s, %s, %s, %s)" \
+        self.doModify("INSERT INTO grouppquota (groupid, printerid, softlimit, hardlimit, datelimit) VALUES (%s, %s, %s, %s, %s)" \
                           % (self.doQuote(gpq.Group.ident), \
                              self.doQuote(gpq.Printer.ident), \
                              self.doQuote(gpq.SoftLimit), \
                              self.doQuote(gpq.HardLimit), \
-                             self.doQuote(gpq.DateLimit), \
-                             self.doQuote(gpq.MaxJobSize)))
+                             self.doQuote(gpq.DateLimit)))
         gpq.isDirty = False
         return None # the entry created doesn't need further modification
@@ -664,5 +664,5 @@
         self.doModify("UPDATE printers SET passthrough=%s, maxjobsize=%s, description=%s, priceperpage=%s, priceperjob=%s WHERE id=%s" \
                               % (self.doQuote((printer.PassThrough and "t") or "f"), \
-                                 self.doQuote(printer.MaxJobSize or 0), \
+                                 self.doQuote(printer.MaxJobSize), \
                                  self.doQuote(unicodeToDatabase(printer.Description)), \
                                  self.doQuote(printer.PricePerPage or 0.0), \
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)
 
Index: pykota/trunk/pykota/storage.py
===================================================================
--- pykota/trunk/pykota/storage.py (revision 3526)
+++ pykota/trunk/pykota/storage.py (revision 3549)
@@ -354,4 +354,9 @@
         return jobprice
 
+    def setMaxJobSize(self, maxjobsize) :
+        """Sets the maximal job size for this print quota entry."""
+        self.MaxJobSize = maxjobsize
+        self.isDirty = True
+
     def delete(self) :
         """Deletes an user print quota entry from the database."""
@@ -380,5 +385,4 @@
         self.HardLimit = None
         self.DateLimit = None
-        self.MaxJobSize = None
 
     def __getattr__(self, name) :
Index: pykota/trunk/pykota/version.py
===================================================================
--- pykota/trunk/pykota/version.py (revision 3547)
+++ pykota/trunk/pykota/version.py (revision 3549)
@@ -24,5 +24,5 @@
 import time
 
-__version__ = "1.27alpha12_unofficial"
+__version__ = "1.27alpha13_unofficial"
 
 __doc__ = "PyKota : a complete Printing Quota Solution for CUPS."
