Skip to content

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

@Tsajan

Description

@Tsajan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions