-
Notifications
You must be signed in to change notification settings - Fork 40
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
About daily sequence #31
Comments
This should work: from datetime import datetime, timezone
from sequences import get_next_value
get_next_value(f"books-{datetime.now(timezone.utc).date().isoformat()}") Swap |
Sorry I'm new to Python. I would like to ask how I can fallback to previous value if some transaction fails? say, with transaction.atomic(): For example, if get_next_value is 2 and save to database fails, I hope the seq can be reverted to 1, how can it be achieved? |
That should already happen - as the README says:
|
Hey, this is very useful, please put it in the README! I need a sequence of the form |
Sure, we could do that, would you like to prepare a PR @spapas ? |
Indeed, we could add an "Examples" section after "API" and before "Database support". |
Hey friends, I've submitted PR #35 with the examples section. Kind regards, |
Hello, I would like to generate a sequence which renews everyday. Is there any function to do so?
e.g. yyyymmddNN. where NN will start from 01 for each date. Thanks.
The text was updated successfully, but these errors were encountered: