Changeset 3258
- Timestamp:
- 11/26/07 11:42:53 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/sql.py
r3184 r3258 352 352 def getUserFromBackend(self, username) : 353 353 """Extracts user information given its name.""" 354 result = self.doSearch("SELECT * FROM users WHERE username=%s LIMIT 1"\354 result = self.doSearch("SELECT * FROM users WHERE username=%s"\ 355 355 % self.doQuote(self.userCharsetToDatabase(username))) 356 356 if result : … … 361 361 def getGroupFromBackend(self, groupname) : 362 362 """Extracts group information given its name.""" 363 result = self.doSearch("SELECT groups.*,COALESCE(SUM(balance), 0.0) AS balance, COALESCE(SUM(lifetimepaid), 0.0) AS lifetimepaid FROM groups LEFT OUTER JOIN users ON users.id IN (SELECT userid FROM groupsmembers WHERE groupid=groups.id) WHERE groupname=%s GROUP BY groups.id,groups.groupname,groups.limitby,groups.description LIMIT 1" \363 result = self.doSearch("SELECT groups.*,COALESCE(SUM(balance), 0.0) AS balance, COALESCE(SUM(lifetimepaid), 0.0) AS lifetimepaid FROM groups LEFT OUTER JOIN users ON users.id IN (SELECT userid FROM groupsmembers WHERE groupid=groups.id) WHERE groupname=%s GROUP BY groups.id,groups.groupname,groups.limitby,groups.description" \ 364 364 % self.doQuote(self.userCharsetToDatabase(groupname))) 365 365 if result : … … 370 370 def getPrinterFromBackend(self, printername) : 371 371 """Extracts printer information given its name.""" 372 result = self.doSearch("SELECT * FROM printers WHERE printername=%s LIMIT 1" \372 result = self.doSearch("SELECT * FROM printers WHERE printername=%s" \ 373 373 % self.doQuote(self.userCharsetToDatabase(printername))) 374 374 if result : … … 379 379 def getBillingCodeFromBackend(self, label) : 380 380 """Extracts a billing code information given its name.""" 381 result = self.doSearch("SELECT * FROM billingcodes WHERE billingcode=%s LIMIT 1" \381 result = self.doSearch("SELECT * FROM billingcodes WHERE billingcode=%s" \ 382 382 % self.doQuote(self.userCharsetToDatabase(label))) 383 383 if result :