[Et-mgmt-commits-list] [SCM] virt-factory branch, master now at 80482a567bc117fdb5e070575f3bf16ce6a3f45e
Scott Seago
sseago at redhat.com
Tue Jun 19 19:04:58 UTC 2007
Hello,
This is an automated email from the git hooks/update script, it was
generated because a ref change was pushed to the repository.
Updating branch, master,
via 80482a567bc117fdb5e070575f3bf16ce6a3f45e (commit)
from b53b7828b467612f894bcce0c4ef96a9cf2bf308 (commit)
- Log -----------------------------------------------------------------
commit 80482a567bc117fdb5e070575f3bf16ce6a3f45e
Author: Scott Seago <sseago at redhat.com>
Date: Tue Jun 19 15:04:52 2007 -0400
more limit/offset hacking
-----------------------------------------------------------------------
Diffstat:
service/modules/deployment.py | 8 ++++----
service/modules/machine.py | 8 ++++----
service/modules/regtoken.py | 4 ++--
service/server/db.py | 7 ++-----
4 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/service/modules/deployment.py b/service/modules/deployment.py
index 1064dae..20a990d 100755
--- a/service/modules/deployment.py
+++ b/service/modules/deployment.py
@@ -407,8 +407,8 @@ class Deployment(web_svc.AuthWebSvc):
result = []
hostname = args['hostname']
offset, limit = self.offset_and_limit(args)
- query = session.query(db.Deployment)
- for deployment in query.select_by(hostname=hostname, offset=offset, limit=limit):
+ query = session.query(db.Deployment).offset(offset).limit(limit)
+ for deployment in query.select_by(hostname=hostname):
result.append(self.expand(deployment))
return success(result)
finally:
@@ -447,8 +447,8 @@ class Deployment(web_svc.AuthWebSvc):
result = []
regtoken = args['registration_token']
offset, limit = self.offset_and_limit(args)
- query = session.query(db.Deployment)
- for deployment in query.select_by(registration_token=regtoken, offset=offset, limit=limit):
+ query = session.query(db.Deployment).offset(offset).limit(limit)
+ for deployment in query.select_by(registration_token=regtoken):
result.append(self.expand(deployment))
return success(result)
finally:
diff --git a/service/modules/machine.py b/service/modules/machine.py
index b4282a0..b553d87 100755
--- a/service/modules/machine.py
+++ b/service/modules/machine.py
@@ -283,8 +283,8 @@ class Machine(web_svc.AuthWebSvc):
result = []
hostname = args['hostname']
offset, limit = self.offset_and_limit(args)
- query = session.query(db.Machine)
- for machine in query.select_by(hostname = hostname, offset=offset, limit=limit):
+ query = session.query(db.Machine).offset(offset).limit(limit)
+ for machine in query.select_by(hostname = hostname):
result.append(self.expand(machine))
return codes.success(result)
finally:
@@ -328,8 +328,8 @@ class Machine(web_svc.AuthWebSvc):
result = []
regtoken = args['registration_token']
offset, limit = self.offset_and_limit(args)
- query = session.query(db.Machine)
- for machine in query.select_by(registration_token = regtoken, offset=offset, limit=limit):
+ query = session.query(db.Machine).offset(offset).limit(limit)
+ for machine in query.select_by(registration_token = regtoken):
result.append(self.expand(machine))
return codes.success(result)
finally:
diff --git a/service/modules/regtoken.py b/service/modules/regtoken.py
index 8e1bf37..ae3a577 100755
--- a/service/modules/regtoken.py
+++ b/service/modules/regtoken.py
@@ -125,9 +125,9 @@ class RegToken(web_svc.AuthWebSvc):
try:
result = []
offset, limit = self.offset_and_limit(args)
- query = session.query(db.RegToken)
+ query = session.query(db.RegToken).offset(offset).limit(limit)
tknstr = args['token']
- for rt in query.select_by(token=tknstr, offset=offset, limit=limit):
+ for rt in query.select_by(token=tknstr):
result.append(self.expand(rt))
return success(result)
finally:
diff --git a/service/server/db.py b/service/server/db.py
index 704b653..6db1cc3 100644
--- a/service/server/db.py
+++ b/service/server/db.py
@@ -223,11 +223,8 @@ class Base(object):
def __list(self, session, offset=0, limit=0):
result = []
- query = session.query(self)
- if limit > 0:
- result = query.select(offset=offset, limit=limit)
- else:
- result = query.select()
+ query = session.query(self).offset(offset).limit(limit)
+ result = query.select()
return result
get = classmethod(__get)
hooks/update
---
Git Source Code Management System
hooks/update refs/heads/master \
b53b7828b467612f894bcce0c4ef96a9cf2bf308 \
80482a567bc117fdb5e070575f3bf16ce6a3f45e
More information about the Et-mgmt-commits-list
mailing list