[Zope] checking for elements in a list
Chris Withers
chris at simplistix.co.uk
Mon Dec 5 02:49:08 EST 2005
Christopher Rivard wrote:
> http://groups.yahoo.com/group/zope/message/150345
I'm working offline, so can't see what you're refering to.
> The solution that I have come to is to simply set a cookie and serve up
> the correct fields based on the cookie:
>
> <dtml-if "17 in list_map_dir_id and 21 not in list_map_dir_id">
> <dtml-call "RESPONSE.setCookie(list_type,'lodge')">
> <dtml-elif "21 in list_map_dir_id and 17 not in list_map_dir_id">
> <dtml-call "RESPONSE.setCookie(list_type,'resto')">
> <dtml-elif "21 in list_map_dir_id and 17 in list_map_dir_id">
> <dtml-call "RESPONSE.setCookie(list_type,'restolodge')">
> <dtml-else>
> <dtml-call "RESPONSE.setCookie(list_type,'other')">
> </dtml-if>
>
> <dtml-in insert_listing1_sql>
> id: <dtml-var newid>
> <dtml-call "REQUEST.set('list_map_list_id', newid)">
> </dtml-in>
> <dtml-call insert_listing_map_sql>
> <dtml-call
> "RESPONSE.redirect('add_listing2?list_id=%s'%(REQUEST['list_map_list_id']))">
Oh my god! What the hell are you doing? Want some plyers to pull your
fingernails out while you're at it?!
> I am sure there are more elegant ways to do this - the client wanted
> the data in a RDBMS for portability....yah yah yah....
...and it looks like you don't have a clue about relational databases.
Sounds like you want to have an establishments table, a "features"
table, and then learn to do a join on both to get the features for a
given establishment.
sheesh, I'm on the verge of tears having read the above...
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the Zope
mailing list