Friendlier api for functions like cqlengine.AbstractQuerySet.only to use variable arguments

Description

I think it would be nice to change the implementation of functions like `defer` and `only` to accept a variable number of arguments. Unfortunately this would be backwards incompatible so I understand this may not be accepted.

Let's say the new version of `only` is defined like this:

Instead of

Use cases:
1. Passing in one field.
Old code

New code

2. Passing in multiple fields.
Old code

New code

3. Passing in a list of fields
Old code

New code

Perhaps with the exception of the last example, I think the new api is easier to use and less prone to mistakes.

Environment

None

Pull Requests

None

Activity

Show:
Alan Boudreault
April 17, 2018, 5:24 AM

Thanks for the suggestion. I agree with you that it would be a better API and I also like the fact that we are going to be aligned with the Django api. Since this is breaking the current api, I set this ticket for the next major release.

Assignee

Unassigned

Reporter

Jacques Kvam

Fix versions

Labels

PM Priority

None

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Pull Request

None

Sprint

Py P-MAJOR-NEXT

Affects versions

Priority

Trivial