filter class for two properties (combined with OR) + retired items
Nagy Gabor <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <20230227232013.014d7cd1@Dell> |
Dear Roundup Users,
IIRC I've asked this one or two years ago, but there were many
improvements in class filtering since then, so there might be an easy
solution for my problem:
1) Assume that my schema.py looks like this:
issue = IssueClass(db, "issue",
...
assignedto=Link("user"),
supervisor=Link("user"),
...)
I want to query all issues for which assignedto = 4 OR supervisor = 4.
(I want to list all issues for which user 4 is somehow responsible.)
What is the best way to do that? I know that there is a filter_sql
method, but I did not find any example using that method. (After
investigating my mysql tables, probably I could come up with an SQL
command, but it would be comforting to see at least one fitler_sql
example.)
2) In fact, my issue class has also has this property:
issue = IssueClass(db, "issue",
...
messages = Multilink("msg", rev_multilink="owner"),
...)
Now I want to filter those messagers for which owner.assignedto = -1 OR
owner = -1. (The msgs are commited to the db by a patched
version of roundup-mailgw and there can be orphan msgs without owner.)
I thought that owner.assignedto = -1 will list msgs with unset owner,
too, but it is not the case: It filters msgs for which there exists at
least one owner with unset assignedto.
+1) Related to question 1 (after reading filter_sql()'s documentation).
Retiring an item is something like make it hidden, right? I mean,
retiring an exiting item (let's say, user 4) won't break anything
(e.g., the information "issue 123's assignedto property is set to 4"
is not lost from the db), just user 4 is hidden from the web interface's
field() method of hyperdb property wrapper etc. And if I restore user
4, then it in fact unhides it. I am just asking this to be sure that
deleting an user won't break anything: all old information related to
that user is still in the db?
Regards,
Gábor
_______________________________________________
Roundup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/roundup-users