Forum OpenACS Q&A: Response to photodb for openACS

Collapse
Posted by Vinod Kurup on
I wasn't sure of the best way to handle this. I think we should
take the states join out of the main query. The only reason we
want the states query is to find the long name of the state,  so we
can just do a simple select further down the page, if the state
variable is not empty.

Take a look at the /photodb/photo.tcl page. I made this
adjustment on that page, but I forgot to do it on the
/photodb/admin/photo.tcl page.

As for the second problem - this won't come up anymore, since
we're not directly comparing the 2 tables, but I probably should
have made state a char(2). The problem is, if you enter a '' into a
char(2), when you get it out, it comes back as '  ' (2 spaces). So, it
doesn't look like an empty string. This is easy enough to fix by
doing a [string trim state].

You're right - this would've been made easier by adding a '' value
to the states table, or by getting rid of the state question
altogether, but I didn't want to change any tables not assoc with
photodb and I wanted this OpenACS implementation to look as
much like the ACS implementation as possible.

I'll upload the fixed version to the file-storage module today.

Thanks for the notice Lachlan. This is the first thing I've ported to
OpenACS, so I appreciate all the feedback!