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

Identify projects in an instance based on project id rather than project name #30

Open
Tsajan opened this issue Jul 3, 2024 · 0 comments

Comments

@Tsajan
Copy link

Tsajan commented Jul 3, 2024

For the Instance class, any project in the given PB instance is currently identified using its name i.e., we currently use --
project = instance.get_project('projectName')

Although this is not an issue, but rather code refactoring for ease, I would suggest the get_project() method of the Instance class to take in the project.project_id parameter rather than project.name.

Turns out the Project class has no property called project_id. As such, I might as well suggest changing the constructor of the Project class to include project_id property.

I am suggesting this because when retrieving project metadata for a given PB instance, the keys for the dictionary returned, are based on project_id that is specified in the .pb file rather than project.name. This currently bears no issue whatsoever with the current operation of the how the library works but this might optimize the way some calls are made. Also, it is noteworthy to mention that instances of Ballot and Profile classes identify user votes and overall voting profile showing project IDs rather than name

image

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

1 participant