witten
/
luminotes
Archived
1
0
Fork 0
This repository has been archived on 2023-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
luminotes/controller/Database.py

520 lines
15 KiB
Python
Raw Permalink Normal View History

import re
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
import os
import os.path
import sys
import sha
import cherrypy
import random
import threading
from model.Persistent import Persistent
from model.Notebook import Notebook
class Connection_wrapper( object ):
def __init__( self, connection ):
self.connection = connection
self.pending_saves = []
def __getattr__( self, name ):
return getattr( self.connection, name )
def synchronized( method ):
def lock( self, *args, **kwargs ):
if self.lock:
self.lock.acquire()
try:
return method( self, *args, **kwargs )
finally:
if self.lock:
self.lock.release()
return lock
class Database( object ):
ID_BITS = 128 # number of bits within an id
ID_DIGITS = "0123456789abcdefghijklmnopqrstuvwxyz"
# caching Notebooks causes problems because different users have different read_write/owner values
CLASSES_NOT_TO_CACHE = ( Notebook, )
def __init__( self, connection = None, cache = None, host = None, ssl_mode = None, data_dir = None ):
"""
Create a new database and return it.
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@type connection: existing connection object with cursor()/close()/commit() methods, or NoneType
@param connection: database connection to use (optional, defaults to making a connection pool)
@type cache: cmemcache.Client or something with a similar API, or NoneType
@param cache: existing memory cache to use (optional, defaults to making a cache)
@type host: unicode or NoneType
@param host: hostname of PostgreSQL database, or None to use a local SQLite database
@type ssl_mode: unicode or NoneType
@param ssl_mode: SSL mode for the database connection, one of "disallow", "allow", "prefer", or
"require". ignored if host is None
@type data_dir: unicode or NoneType
@param data_dir: directory in which to store data (defaults to a reasonable directory). ignored
if host is not None
@rtype: Database
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@return: newly constructed Database
"""
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
# This tells PostgreSQL to give us timestamps in UTC. I'd use "set timezone" instead, but that
# makes SQLite angry.
os.putenv( "PGTZ", "UTC" )
if host is None:
from pysqlite2 import dbapi2 as sqlite
from datetime import datetime
from pytz import utc
TIMESTAMP_PATTERN = re.compile( "^(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d).(\d+)(?:\+\d\d:\d\d$)?" )
MICROSECONDS_PER_SECOND = 1000000
def convert_timestamp( value ):
( year, month, day, hours, minutes, seconds, fractional_seconds ) = \
TIMESTAMP_PATTERN.search( value ).groups( 0 )
# convert fractional seconds (with an arbitrary number of decimal places) to microseconds
microseconds = int( fractional_seconds )
while microseconds > MICROSECONDS_PER_SECOND:
fractional_seconds = fractional_seconds[ : -1 ]
microseconds = int( fractional_seconds or 0 )
# ignore time zone in timestamp and assume UTC
return datetime(
int( year ), int( month ), int( day ),
int( hours ), int( minutes ), int( seconds ), int( microseconds ),
utc,
)
sqlite.register_converter( "boolean", lambda value: value in ( "t", "True", "true" ) and True or False )
sqlite.register_converter( "timestamp", convert_timestamp )
if connection:
self.__connection = connection
else:
if data_dir is None:
if sys.platform.startswith( "win" ):
data_dir = os.path.join( os.environ.get( "APPDATA" ), "Luminotes" )
else:
data_dir = os.path.join( os.environ.get( "HOME", "" ), ".luminotes" )
data_filename = os.path.join( data_dir, "luminotes.db" )
# if the user doesn't yet have their own luminotes.db file, make them an initial copy
if os.path.exists( "luminotes.db" ):
if not os.path.exists( data_dir ):
import stat
os.makedirs( data_dir, stat.S_IXUSR | stat.S_IRUSR | stat.S_IWUSR )
if not os.path.exists( data_filename ):
import shutil
shutil.copyfile( "luminotes.db", data_filename )
self.__connection = \
Connection_wrapper( sqlite.connect( data_filename, detect_types = sqlite.PARSE_DECLTYPES, check_same_thread = False ) )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
self.__pool = None
self.__backend = Persistent.SQLITE_BACKEND
self.lock = threading.Lock() # multiple simultaneous client threads make SQLite angry
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
else:
import psycopg2 as psycopg
from psycopg2.pool import PersistentConnectionPool
# forcibly replace psycopg's connect() function with another function that returns the psycopg
# connection wrapped in a class with a pending_saves member, used in save() and commit() below
original_connect = psycopg.connect
def connect( *args, **kwargs ):
return Connection_wrapper( original_connect( *args, **kwargs ) )
psycopg.connect = connect
if connection:
self.__connection = connection
self.__pool = None
else:
self.__connection = None
self.__pool = PersistentConnectionPool(
1, # minimum connections
50, # maximum connections
"host=%s sslmode=%s dbname=luminotes user=luminotes password=%s" % (
host or "localhost",
ssl_mode or "allow",
os.getenv( "PGPASSWORD", "dev" )
),
)
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
self.__backend = Persistent.POSTGRESQL_BACKEND
self.lock = None # PostgreSQL does its own synchronization
self.__cache = cache
try:
if self.__cache is None:
import cmemcache
print "using memcached"
except ImportError:
return None
def get_connection( self ):
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
if self.__connection:
return self.__connection
else:
return self.__pool.getconn()
def __get_cache_connection( self ):
if self.__cache is not None:
return self.__cache
try:
import cmemcache
return cmemcache.Client( [ "127.0.0.1:11211" ], debug = 0 )
except ImportError:
return None
def unescape( self, sql_command ):
"""
For backends that don't treat backslashes specially, un-double all backslashes in the given
sql_command.
"""
if self.__backend == Persistent.SQLITE_BACKEND:
return sql_command.replace( "\\\\", "\\" )
return sql_command
@synchronized
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
def save( self, obj, commit = True ):
"""
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
Save the given object to the database.
@type obj: Persistent
@param obj: object to save
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@type commit: bool
@param commit: True to automatically commit after the save
"""
connection = self.get_connection()
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
cursor = connection.cursor()
cursor.execute( self.unescape( obj.sql_exists() ) )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
if cursor.fetchone():
cursor.execute( self.unescape( obj.sql_update() ) )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
else:
cursor.execute( self.unescape( obj.sql_create() ) )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
if isinstance( obj, self.CLASSES_NOT_TO_CACHE ):
cache = None
else:
cache = self.__get_cache_connection()
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
if commit:
connection.commit()
if cache:
cache.set( obj.cache_key, obj )
elif cache:
# no commit yet, so don't touch the cache
connection.pending_saves.append( obj )
@synchronized
def commit( self ):
connection = self.get_connection()
connection.commit()
# save any pending saves to the cache
cache = self.__get_cache_connection()
if cache:
2008-03-07 23:20:32 +00:00
for obj in connection.pending_saves:
cache.set( obj.cache_key, obj )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
connection.pending_saves = []
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@synchronized
def rollback( self ):
connection = self.get_connection()
connection.rollback()
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
def load( self, Object_type, object_id, revision = None ):
"""
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
Load the object corresponding to the given object id from the database and return it, or None if
the object_id is unknown. If a revision is provided, a specific revision of the object will be
loaded.
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@type Object_type: type
@param Object_type: class of the object to load
@type object_id: unicode
@param object_id: id of the object to load
@type revision: int or NoneType
@param revision: revision of the object to load (optional)
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@rtype: Object_type or NoneType
@return: loaded object, or None if no match
"""
if revision or Object_type in self.CLASSES_NOT_TO_CACHE:
cache = None
else:
cache = self.__get_cache_connection()
if cache: # don't bother caching old revisions
obj = cache.get( Persistent.make_cache_key( Object_type, object_id ) )
if obj:
return obj
obj = self.select_one( Object_type, Object_type.sql_load( object_id, revision ) )
if obj and cache:
cache.set( obj.cache_key, obj )
return obj
@synchronized
def select_one( self, Object_type, sql_command, use_cache = False ):
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
"""
Execute the given sql_command and return its results in the form of an object of Object_type,
or None if there was no match.
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@type Object_type: type
@param Object_type: class of the object to load
@type sql_command: unicode
@param sql_command: SQL command to execute
@type use_cache: bool
@param use_cache: whether to look for and store objects in the cache
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@rtype: Object_type or NoneType
@return: loaded object, or None if no match
"""
if not use_cache or Object_type in self.CLASSES_NOT_TO_CACHE:
cache = None
else:
cache = self.__get_cache_connection()
if cache:
cache_key = sha.new( sql_command ).hexdigest()
obj = cache.get( cache_key )
if obj:
return obj
connection = self.get_connection()
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
cursor = connection.cursor()
cursor.execute( self.unescape( sql_command ) )
row = self.__row_to_unicode( cursor.fetchone() )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
if not row:
return None
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
if Object_type in ( tuple, list ):
obj = Object_type( row )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
else:
obj = Object_type( *row )
if obj and cache:
cache.set( cache_key, obj )
return obj
@synchronized
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
def select_many( self, Object_type, sql_command ):
"""
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
Execute the given sql_command and return its results in the form of a list of objects of
Object_type.
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@type Object_type: type
@param Object_type: class of the object to load
@type sql_command: unicode
@param sql_command: SQL command to execute
@rtype: list of Object_type
@return: loaded objects
"""
connection = self.get_connection()
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
cursor = connection.cursor()
cursor.execute( self.unescape( sql_command ) )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
objects = []
row = self.__row_to_unicode( cursor.fetchone() )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
while row:
if Object_type in ( tuple, list ):
obj = Object_type( row )
else:
obj = Object_type( *row )
objects.append( obj )
row = self.__row_to_unicode( cursor.fetchone() )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
return objects
def __row_to_unicode( self, row ):
if row is None:
return None
return [ isinstance( item, str ) and unicode( item, encoding = "utf8" ) or item for item in row ]
@synchronized
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
def execute( self, sql_command, commit = True ):
"""
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
Execute the given sql_command.
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@type sql_command: unicode
@param sql_command: SQL command to execute
@type commit: bool
@param commit: True to automatically commit after the command
"""
connection = self.get_connection()
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
cursor = connection.cursor()
cursor.execute( self.unescape( sql_command ) )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
if commit:
connection.commit()
@synchronized
def execute_script( self, sql_commands, commit = True ):
"""
Execute the given sql_commands.
@type sql_command: unicode
@param sql_command: multiple SQL commands to execute
@type commit: bool
@param commit: True to automatically commit after the command
"""
connection = self.get_connection()
cursor = connection.cursor()
if self.__backend == Persistent.SQLITE_BACKEND:
cursor.executescript( sql_commands )
else:
cursor.execute( self.unescape( sql_commands ) )
if commit:
connection.commit()
def uncache_command( self, sql_command ):
cache = self.__get_cache_connection()
if not cache: return
cache_key = sha.new( sql_command ).hexdigest()
cache.delete( cache_key )
def uncache( self, obj ):
cache = self.__get_cache_connection()
if not cache: return
cache.delete( obj.cache_key )
def uncache_many( self, Object_type, obj_ids ):
cache = self.__get_cache_connection()
if not cache: return
for obj_id in obj_ids:
cache.delete( Persistent.make_cache_key( Object_type, obj_id ) )
@staticmethod
def generate_id():
int_id = random.getrandbits( Database.ID_BITS )
base = len( Database.ID_DIGITS )
digits = []
while True:
index = int_id % base
digits.insert( 0, Database.ID_DIGITS[ index ] )
int_id = int_id / base
if int_id == 0:
break
return "".join( digits )
@synchronized
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
def next_id( self, Object_type, commit = True ):
"""
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
Generate the next available object id and return it.
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
@type Object_type: type
@param Object_type: class of the object that the id is for
@type commit: bool
@param commit: True to automatically commit after storing the next id
"""
connection = self.get_connection()
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
cursor = connection.cursor()
# generate a random id, but on the off-chance that it collides with something else already in
# the database, try again
next_id = Database.generate_id()
cursor.execute( self.unescape( Object_type.sql_id_exists( next_id ) ) )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
while cursor.fetchone() is not None:
next_id = Database.generate_id()
cursor.execute( self.unescape( Object_type.sql_id_exists( next_id ) ) )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
# save a new object with the next_id to the database
obj = Object_type( next_id )
cursor.execute( self.unescape( obj.sql_create() ) )
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
if commit:
connection.commit()
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
return next_id
@synchronized
def close( self ):
"""
Shutdown the database.
"""
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
if self.__connection:
self.__connection.close()
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
if self.__pool:
self.__pool.closeall()
backend = property( lambda self: self.__backend )
def end_transaction( function ):
"""
Decorator that prevents transaction leaks by rolling back any transactions left open when the
wrapped function returns or raises.
"""
def rollback( *args, **kwargs ):
try:
return function( *args, **kwargs )
finally:
cherrypy.root.database.rollback()
return rollback
class Valid_id( object ):
"""
Validator for an object id.
"""
ID_PATTERN = re.compile( "^[%s]+$" % Database.ID_DIGITS )
def __init__( self, none_okay = False ):
self.__none_okay = none_okay
def __call__( self, value ):
if value in ( None, "None", "" ):
if self.__none_okay:
return None
else:
raise ValueError()
if self.ID_PATTERN.search( value ): return str( value )
raise ValueError()
class Valid_revision( object ):
"""
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
Validator for an object revision timestamp.
"""
Merged revisions 401-446 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres ................ r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-401" from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ................ r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines Beginning a conversion from bsddb to postgres. ................ r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines Merged revisions 402-404 via svnmerge from svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk ........ r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines Yay, no more stupid deprecation warnings from simplejson about the sre module. ........ ................ r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5 * Began removal of all references to Scheduler, @async, yield, and so on. * Converted Database.py to support PostgreSQL and updated its unit tests accordingly. ................ r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines All unit tests for the new model classes now pass. ................ r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines Reordering some columns and adding some indices. ................ r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines Now adding trash notebooks to user_notebook table. Also switching db conversion/verification tools back to require Python 2.5, since they still use the old Scheduler, which requires 2.5 generator features. ................ r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff. ................ r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines controller.Users unit tests now finally pass! ................ r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines Got controller.Root unit tests passing. Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests. ................ r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines All unit tests pass! Fuck yeah! ................ r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines Removing all references to Scheduler from luminotes.py ................ r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines Converted deleted_from to deleted_from_id in a few more places. Fixed bug in Users.contents(). ................ r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines Typo fix in Note sql method. Adding autocommit flag to Database.next_id() method. ................ r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines Updating unit test for new auto commit flag. ................ r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines Removing debugging print. ................ r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines More sql fixes. I really need some funtional tests that hit the database and exercise the SQL. ................ r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines Fixed controller.Database handling of tuple as an Object_type. Made SQL for user storage calculation better at handling null values and also more succinct. ................ r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines Converting Wiki.js to trash_id notebook member instead of trash object. ................ r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software. ................ r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines Notebooks.contents() now returns notebooks with correct read-write status. ................ r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing" ................ r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines No longer redirecting to trash notebook upon login. ................ r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines Made controller.Database use a connection pool. ................ r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines Converted initdb.py and updatedb.py to Postgres from bsddb. ................ r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines Changing error message to remove underscores from variable names. ................ r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines Removing unused note_title parameter from Wiki.create_editor(). ................ r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines Revision regular expression now supports timezone notation. ................ r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.) ................ r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines More strict access checking. Fixed oversight in Postgres DB conversion where, in certain controller.Notebook methods, access was only checked at the notebook level, not at the note level as well. ................ r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines Now loading revisions on demand from client when the "changes" button is clicked. Also caching loading revisions so subsequent clicks don't have to reload. ................ r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client. ................ r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball. ................ r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines Updated install instructuctions to include use of initdb.py. ................ r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines Made initdb.py only nuke (drop tables/views) when given a command-line flag. Also made install directions more correct. ................ r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines IE 6 doesn't like commas. ................ r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has something in it ................ r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines Forgot to actually save off the new revision as editor.revision. ................ r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines More intelligent datetime handling: * convertdb.py assumes old bsddb database timestamps are Pacific, and then converts them to UTC before inserting them into the new PostgreSQL database. * No longer using naked timezoneless datetime objects in model/controller code, except in unit tests that need compatability with pysqlite. Now using UTC everwhere. * Asking PostgreSQL to give us all timestamps back in UTC. * New dependency on python-tz (pytz) package, noted in INSTALL doc. * Client now responsible for converting UTC timestamps to local time for display. ................ r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines Tweak to prevent potential race in IE. ................ r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines Got JavaScript "unit" tests passing again. ................ r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines Noting that js tests require the Luminotes server on localhost. ................
2007-10-11 09:03:43 +00:00
REVISION_PATTERN = re.compile( "^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d\.\d+[+-]\d\d(:)?\d\d$" )
def __init__( self, none_okay = False ):
self.__none_okay = none_okay
def __call__( self, value ):
if self.__none_okay and value in ( None, "None", "" ): return None
if self.REVISION_PATTERN.search( value ): return str( value )
raise ValueError()