Access user attributes from BasicUser object

My goal is to show the list of users that belongs to a specific Roster.

I tried the following code but i got stuck and i don't know how to continue:

#Get the roster
roster = system.roster.getRoster(self.view.params.roster_name)
for user_ref in roster.getUsers():
   username = user_ref.get('username') 

it throws the following error:

TypeError: get(): 1st arg can't be coerced to com.inductiveautomation.ignition.common.config.Property

Here's some information i found:

  • roster.getUsers() returns a list of BasicUser objects
  • print(str(user_ref)) => {badge=null, schedule=Always, firstname=Luca, notes=null, language=it_IT, user.pin=, username=Elettricista1, lastname=Rossi}
  • user_ref.Username = username

What i expect is to find a way to retrieve this damn username.

Big thanks to anyone throwing some help my way!

Try:
user_ref.get(user_ref.Username)

It works!
Thank you very much Paul