First off - my apologies to all who have replied so diligently without
so much as a "hi" from me before now...  soon after posting this I
fell ill and did not have an opportunity to reply.

Second; I posted this same message three days ago and for some unknown
reason, it did not show up on the mailing list (?).

Finally, thanks to Emily and Bruno for supplying suggestions and
having to make educated guesses or do crystal-ball gazing... apologies
for not phrasing or constructing my original question very clearly.

Now back to the problem...

This _is_ a somewhat artificially constructed problem as I am trying
to get a bearing on how to do this in my actual code, without getting
bogged down in all its nuances.  Nonetheless, this is a very good
parallel to the situation I am dealing with.

I am not trying to calculate an _actual_ discount here (although the
code supplied by Emily may be helpful at some point) - rather I am
trying to figure how to ask a question (i.e write a query) that has a
True/False answer - which I would state loosely in English "does this
qualify for a discount"? or, more explicitly "does the Passenger's
membership of (one or more) Alliances match any of the Airline's
membership of (one or more) Alliances"?

To expand further:

Case 1: If Passenger 57 has membership of Alliance==Pacific and
Alliance==European, then according to the situation postulated above
the answer should be "False".
Case 2: If, however, Passenger 57 has membership of Alliance==Pacific
and Alliance==Star, then the answer would be "True" (because AIA also
has membership of Alliance==Star).

I was hoping there would be a simple "one liner" that could give this
result... I am more looking for guidance in how to do this kind of
querying with the Django ORM rather than help with model or database
construction.

Thanks again - I will try and clarify more quickly in future.

Derek

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to