Re: how to switch a view easily?

[prev] [thread] [next] [Date index for 2005/04/20]

From: Mark Addison
Subject: Re: how to switch a view easily?
Date: 13:12 on 20 Apr 2005
On Wed, 2005-04-20 at 08:07 -0400, Dana Hudes wrote: 
> How about moving deleted bookings to a separate deleted_bookings table?
> you will make an extra query against the database if they want to see 
> deleted bookings.

That can get pretty messy with all the joins.

> On Wed, 19 Apr 2005, Randal L. Schwartz wrote:
> > My $client has an app with "Booking" being a centrally important
> > joining table (lots of has-many's on both sides).  One of the fields
> > of Booking indicates whether the Booking has been deleted.  Now
> > $client wants entire app to have two modes... "include deleted
> > bookings" and "exclude deleted bookings".
> > 
> > Other than changing all my nice nifty working code to include huge
> > amounts of new ->search_where's everywhere... is there some easy
> > method I can use instead?
> > 
> > Certainly I can't be the first one to need this. :)

What database is this running on? Specifically does it have views?
If so could you create views for the 2 sets and then use a quick
sub-class that just changes the table (view) it uses. Then all your
nifty code is shared by both and the mode can be set by the class you
use.

mark
--

This email (and any attachments) is intended solely for the individual(s) to whom addressed. 
It may contain confidential and/or legally privileged information. 
Any statement or opinions therein are not necessarily those of ITN unless specifically stated. 
Any unauthorised use, disclosure or copying is prohibited. 
If you have received this email in error, please notify the sender and delete it from your system. 
Security and reliability of the e-mail and attachments are not guaranteed. 
You must take full responsibility for virus checking.



Independent Television News Limited, 

Registered No. 548648 England,

VAT Reg. No: GB 756 2995 81, 

200 Gray's Inn Road, London WC1X 8XZ,

Telephone: 020 7833 3000.

(message missing)

how to switch a view easily?
merlyn (Randal L. Schwartz) 04:21 on 20 Apr 2005

Re: how to switch a view easily?
merlyn (Randal L. Schwartz) 05:11 on 20 Apr 2005

Re: how to switch a view easily?
Tony Bowden 08:26 on 20 Apr 2005

Re: how to switch a view easily?
Dana Hudes 12:07 on 20 Apr 2005

Re: how to switch a view easily?
Mark Addison 13:12 on 20 Apr 2005

Re: how to switch a view easily?
merlyn (Randal L. Schwartz) 13:55 on 20 Apr 2005

Solved (thank you postgresql!) was Re: how to switch a view easily?
merlyn (Randal L. Schwartz) 16:30 on 20 Apr 2005

multi-column PK and has_many
Barry Moore 18:21 on 20 Apr 2005

Re: multi-column PK and has_many
Perrin Harkins 18:41 on 20 Apr 2005

Re: Solved (thank you postgresql!) was Re: how to switch a view easily?
merlyn (Randal L. Schwartz) 17:10 on 20 Apr 2005

Generated at 09:29 on 27 Apr 2005 by mariachi v0.52