Searches via might-have

[prev] [thread] [next] [Date index for 2004/06/15]

From: Simon Cozens
Subject: Searches via might-have
Date: 10:24 on 15 Jun 2004
Suppose I have table of items of food in stock at my shop, modelled by
MyApp::Food. For complex reasons, the food table relates to a separate 
table, "date" (Myapp::Date), which contains sell_by, best_before and use_by.

Each Food object can only have one Date object, so we use might_have to
import the columns into Food:

    MyApp::Food->might_have(best_before_date => MyApp::Date => "best_before");
    ...

What I'd now like to do is call something on MyApp::Food (preferably) to
search for best before dates between X and Y. Is this possible, or do
I have to do the search on MyApp::Date and map them back to ->food?

        -- 
        DISCLAIMER:
Use of this advanced computing technology does not imply an endorsement
of Western industrial civilization.

Searches via might-have
Simon Cozens 10:24 on 15 Jun 2004

Re: Searches via might-have
Tony Bowden 10:37 on 15 Jun 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52