hi,

this is more a database design question than a SA one.

I have 2 tables, "clients" and "options". A client can subscribe to 
multiple options, and options can be subscribed by multiple clients 
(many-to-many). Of course, we have a weak table for the many-to-many 
relationship.

Then we have a 3rd table, "contents". A content item is related to 
options, but through boolean logic operators: "OR", "AND", "NOT".

My problem is beeing able to represent and store relations between 
"options" and "contents" tables in a normalized way.

Say,
"content A" is destinated subscribers of "option A",
"content B" for subscribers of "option B",
"content A_and_B" for subscribers of "option A" and "option B",
"content A_or_B" for subscribers of "option A" or "option B",
"content A_and_not_B" for subscribers of "option A" and must not be 
subscribed to B,
"content A_or_not_B" for subscribers of "option A" or the ones not 
subscribed to "option B" if not already subscribed to "option A",
"content not_A_or_not_B" for subscribers that neither have "option A" or 
"option B".

I don't need nested logic, like: "option A" and ("option B" or "option C").

Neither do I need to mix "AND" and "OR". Although, each of them needs to 
be mixed with "NOT".

This is pretty much mind twising. But maybe this has already been 
standardized somehow. Any idea how this can be achieved ?

Regards,
-- 
Alexandre CONRAD


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to