diff options
author | Richard Jones <richard@mechanicalcat.net> | 2013-01-14 17:02:46 +1100 |
---|---|---|
committer | Richard Jones <richard@mechanicalcat.net> | 2013-01-14 17:02:46 +1100 |
commit | 6c638cdf9cb67dfea0f0ea8a63af2a0da659055b (patch) | |
tree | 0b2abaed38cfc93bdccad3934b5e4dec78d74b15 | |
parent | e455af4b75e12496a2b9b4d7fdf3f7cade44db8f (diff) | |
download | decorator-6c638cdf9cb67dfea0f0ea8a63af2a0da659055b.tar.gz |
move arg to retain existing ordering
-rw-r--r-- | store.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -657,7 +657,7 @@ class Store: cursor.execute('select name from packages order by name') return [p[0] for p in cursor.fetchall()] - _Journal = FastResultRow('id! action submitted_date! submitted_by submitted_from') + _Journal = FastResultRow('action submitted_date! submitted_by submitted_from id!') def get_journal(self, name, version): ''' Retrieve info about the package from the database. @@ -667,8 +667,8 @@ class Store: ''' cursor = self.get_cursor() # get the generic stuff or the stuff specific to the version - sql = '''select id, action, submitted_date, submitted_by, - submitted_from from journals where name=%s and (version=%s or + sql = '''select action, submitted_date, submitted_by, + submitted_from, id from journals where name=%s and (version=%s or version is NULL) order by submitted_date''' safe_execute(cursor, sql, (name, version)) return Result(None, cursor.fetchall(), self._Journal) @@ -921,16 +921,16 @@ class Store: return Result(None, self.get_unique(cursor.fetchall()), self._Updated_Releases) - _Changelog = FastResultRow('id! name version submitted_date! action') + _Changelog = FastResultRow('name version submitted_date! action id!') def changelog(self, since): - '''Fetch (id, name, version, submitted_date, action) since 'since' + '''Fetch (name, version, submitted_date, action, id) since 'since' argument. ''' assert isinstance(since, int) cursor = self.get_cursor() safe_execute(cursor, ''' - select id, name, version, submitted_date, action + select name, version, submitted_date, action, id from journals j where j.submitted_date > %s ''', (time.strftime('%Y-%m-%d %H:%M:%S +0000', time.gmtime(since)),)) |