Skip to content
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

QuerySetJob cannot be queried using get_or_create method. #60

Open
shubham2892 opened this issue Jun 7, 2016 · 3 comments
Open

QuerySetJob cannot be queried using get_or_create method. #60

shubham2892 opened this issue Jun 7, 2016 · 3 comments

Comments

@shubham2892
Copy link

No description provided.

@stephrdev
Copy link
Collaborator

As the QuerySetJob should be used for caching purposes, I think its ok if get_or_create is not supported. Can you provide a use case which required get_or_create on QuerySetJob?

@shubham2892
Copy link
Author

The use case is same as of get_or_create in general when we want to fetch the entry if exists, if not create and then fetch. With this, it will also cache it after creating the entry.

@stephrdev
Copy link
Collaborator

How yould you handle the "created" flag in this case? To be consistent, it should only be true for the first "get" call. Later cached "get" calls would need to return False for "created".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants