|
@ -2,21 +2,23 @@ export class UserItem { |
|
|
constructor( |
|
|
constructor( |
|
|
public id: number, |
|
|
public id: number, |
|
|
public username: string, |
|
|
public username: string, |
|
|
public is_superuser: boolean |
|
|
|
|
|
|
|
|
public is_superuser: boolean, |
|
|
|
|
|
public is_staff: boolean |
|
|
) {} |
|
|
) {} |
|
|
|
|
|
|
|
|
static valueOf( |
|
|
static valueOf( |
|
|
{ id, username, is_superuser }: |
|
|
|
|
|
{ id: number, username: string, is_superuser: boolean } |
|
|
|
|
|
|
|
|
{ id, username, is_superuser, is_staff }: |
|
|
|
|
|
{ id: number, username: string, is_superuser: boolean, is_staff: boolean } |
|
|
): UserItem { |
|
|
): UserItem { |
|
|
return new UserItem(id, username, is_superuser) |
|
|
|
|
|
|
|
|
return new UserItem(id, username, is_superuser, is_staff) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
toObject(): Object { |
|
|
toObject(): Object { |
|
|
return { |
|
|
return { |
|
|
id: this.id, |
|
|
id: this.id, |
|
|
username: this.username, |
|
|
username: this.username, |
|
|
is_superuser: this.is_superuser |
|
|
|
|
|
|
|
|
is_superuser: this.is_superuser, |
|
|
|
|
|
is_staff: this.is_staff |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |