Forum OpenACS Q&A: Response to SQL: how do you do this?

Collapse
Posted by Jade Rubick on
Very helpful. Thank you!

What I am trying to do is build a listing of freight tables, FROM
somewhere, TO somewhere. The quantity shipped and the price
are related, and it's okay if deleting a price also removed the
quantity.

The first table is a FROM and TO location. The second table is a
listing of prices and quantities shipped.

The issue is that they would like to have a record for arbitrary
quantities. So if they ship 3000 pounds, it will be one price, and
5000 pounds will be another price. They'd then like to be able to
list all of these.

Of the possible shipping quantities, they'd like to have one be
the "default" shipping quantity and price, and one be the currently
"selected" shipping quantity and price.

Does adding in the circular reference make sense in this case?
Putting the status in the quantity (second) table wouldn't make
sense, because only zero or one of the many freight quantities
should be "selected" and zero or one of the freight quantities
should be "default".

Something about it looked really awkward to me, so I asked you
guys for feedback.

Thanks for your help!