[Seaside] Slightly OT -- Glorp session question..

Rick Flower rickf at ca-flower.com
Fri Jun 30 16:19:59 UTC 2006


I'm posting this question here and on the Glorp mailing list 
(separately) to improve my chances of getting a reply..
(hopefully), so I hope you'll bear with me.. I've got a Seaside App that 
needs to read various things from
various PostgreSQL tables using Glorp.. So, I've got all of my 
descriptors setup for my >10 tables I need
access to.. So far my Glorp session only knows about my "users" table 
which it uses to perform login
validations. That code works great and can validate all day long..

However, I now have some other code that needs to lookup a list of state 
abbreviations
(e.g. CA,AZ,UT,NV,etc) and I'm a bit confused about how to go about 
getting that descriptor plugged
into my Glorp session.. I'd rather NOT open another database connection 
if at all possible (I'd hate
to have one db connection for each table I'm talking to -- way too much 
overhead) and am wondering
if I need to redefine my Glorp session code to know about ALL of my 
tables instead of a single one?
Or, can I hijack the "users" Glorp session and temporarily ask it to 
talk to another set of  descriptors at
my discretion?  I've read through the tutorials I've found but most were 
geared towards only talking to
one table at a time or perhaps one table with a foreign key to another, 
but I didn't see any examples
on IF you had two or more separate (unrelated for the most part) tables 
and how to setup Glorp
to talk to those disparate tables at different times within the same 
database session.  I've also review the
Glorp unit tests and didn't see anything similar to what I'm asking 
about above, but did find a few
things that looked close to what I want to do..

Any insight or pointers you can provide would be greatly appreciated!

-- Rick

 


More information about the Seaside mailing list