The Relationships feature is very useful for adding an inner join to the underlying query of a view. But what I also need is a way to select all items that are NOT part of the relationship.
For example, using the Relations module, if I want all photo nodes that belong to a certain user and have a relation to the user's album node, I would set:
- Contextual Filter: Author's uid
- Relationships: Node's nid
Works great.
BUT, if I want to see all the photos that haven't yet been linked to the user's photo album, I need a negative Relationship, like so.
- Contextual Filter: Author's uid
- Relationships: Node's nid [NOT]
Or maybe there's another way to do this?
Comments
Comment #1
dawehnerOh i see you want something like JOIN foo ON foo.uid != bar.uid
Interesting, but i think it would be quite hard to provide a generic/all-time-working solution.
Comment #2
dawehnerJust a slightly related issue: #1043260: Reverse relationship
Comment #3
tomogden commentedReferring to the issue above, it looks like what we want might be implemented by implementing the Views hook in within the Relation module. It's mentioned with regard to the Reference module here:
http://drupal.org/node/1188500#comment-4602988
Comment #4
tomogden commentedRelation module now appears to allow reverse relationships. See #1410124: Reverse doesn't work.
Comment #5
giorgio79 commentedI would like to see sg native in Views, not in Relation :)
Comment #6
dawehnerIt's really not possible to implement that in a really generic way, though for such relationships it's possible,
as you have more context.
Comment #8
Mołot commentedChanging close type - if it's impossible, then it's not fixed.