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

[ADD] spp unique id abstract model #43

Merged
merged 5 commits into from
Dec 8, 2023

Conversation

nhatnm0612
Copy link
Contributor

@nhatnm0612 nhatnm0612 commented Nov 28, 2023

What this does?

  • create an abstract object that holds all methods for creating unique id

related issue: https://github.com/OpenSPP/openspp-registry/issues/273

if not prefix:
rec.registrant_id = False
continue
registrant_id = _generate_unique_id()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we double check it has not been used by querying the DB?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I had sql constraints to guard the duplication, but if you want to, sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremi done 😄

class SppUniqueId(models.AbstractModel):
_name = "spp.unique.id"

registrant_id = fields.Char(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we rename it spp_id? (and the related methods as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will change all the adaptor as well, since we are using this field name through out all the operations, but yes, we can

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremi done 😄

@gonzalesedwin1123 gonzalesedwin1123 merged commit 5d9dc14 into 15.1.1 Dec 8, 2023
1 of 2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants