-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow querying by kind #310
base: main
Are you sure you want to change the base?
Conversation
to filter contacts by given kind
The todo file is very old and we have since introduced a query syntax. I would prefer a new query key word You could split the editing of the kind attribute via the yaml file into a separate commit and move it to #309. Then we can discuss just the query syntax stuff here. Or you can even move the whole code to #309 and call it "support the kind attribute" or so. |
Ah I see, the query syntax vs. options was not clear to me. I'll rework this PR accordingly. |
The motivation is that I simply did not make a release yet. And I was working with my private undocumented policy to not remove stuff unless it has been marked and documented as "deprecated" for at least one release. |
Thanks for the context, @lucc, on why the options are still around. I went ahead and reworked this PR so that it supports querying by |
Do you feel that the existing tests around the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a first review.
There is one important question we have to decide early I think: How to handle "kind" with vcard v3. The rfc for v3 does not talk about kind.
I think we can either not support kind for v3 or we should check what the rfc says about custom attributes and then treat it as a custom field on v3 cards. (see the anniversary field for an example)
@@ -2,6 +2,10 @@ | |||
# from the full name below if not given. | |||
Formatted name : | |||
|
|||
# kind (requires vcard >= 4.0) | |||
# one of: individual, group, org, location, application, device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where did you get "application" and "device" from? I can not see them in the rfc
# one of: individual, group, org, location, application, device | |
# one of: individual, group, org, location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would reference these rfcs in that comment and also at the top of the file.
About the tests: I would hope for some more test that specifically edit the kind field. And depending on if we support kind on v3 we could have test for this case too. |
Thanks for the helpful review, @lucc; much appreciated. I went ahead and addressed your comments. How should |
Regarding |
Friendly ping / nudge requesting re-review of the latest changes, @lucc 🙂 |
Sorry for the delay. I had another look:
Can you also rebase this PR on the current develop branch so the list of commits is cleaned up. |
Thanks for your feedback @lucc, much appreciated 🙏
|
I thought about this a bit more and with my current understanding of things I'd like to run the following by you, @lucc:
Would that kind of approach work? I haven't looked too much into vobject's validation implementation. Are you more knowledgable about it than me and could point me to interesting parts? |
Having a separate validation logic on VCardWrapper might be an interesting idea. But I think we would have to discuss this in a separate issue. For now I suggest we just check the value of the kind directly our self and do not bother to understand or wrap what vobject does in this regard. Like this we can get this PR done and discuss new ideas later on. |
@afh are you still working on this? We (@scheibler and I) are planning to make the 0.18 release this year and I originally wanted to include this as we have merged #309. I just had a look at this and added a kind column to one of my vcards and it did not show up with If you are working on this and want to help get it into the 0.18 release please also rebase on latest develop. Please also drop me a note if you can not work on it this month, then we will go forward with the release without this PR. |
Please go ahead with the 0.18 release excluding this PR. I'm uncertain if or when I'll find the time to continue on this PR. I've forgotten the details, yet I think the issue grew to wider circles, i.e. the vobject library. |
This is a first, likely incomplete, attempt to add an option to filter contact table (--kind) as mentioned in the
todo.txt
.ℹ️ This PR depends on changes introduced in #309 (merged). Please see #309 for details on why this PR does not (yet) contain tests.Any comments on whether this is headed into the right direction or not is greatly appreciated.