Show
Ignore:
Timestamp:
07/26/05 10:35:29 (19 years ago)
Author:
jerome
Message:

dumpykota can now dump billing codes from LDAP too.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r2384 r2386  
    299299        return result         
    300300                 
     301    def getAllBillingCodes(self, billingcode=None) :     
     302        """Extracts all billing codes or only the billing codes matching the optional parameter.""" 
     303        billingcodes = [] 
     304        ldapfilter = "objectClass=pykotaBilling" 
     305        if billingcode : 
     306            ldapfilter = "(&(%s)(pykotaBillingCode=%s))" % (ldapfilter, self.userCharsetToDatabase(billingcode)) 
     307        result = self.doSearch(ldapfilter, ["pykotaBillingCode"], base=self.info["billingcodebase"]) 
     308        if result : 
     309            billingcodes = [self.databaseToUserCharset(bc) for bc in self.filterNames(result, "pykotaBillingCode")] 
     310        return billingcodes 
     311         
    301312    def getAllPrintersNames(self, printername=None) :     
    302313        """Extracts all printer names or only the printers' names matching the optional parameter."""