dosubot[bot] commented on issue #28691:
URL: https://github.com/apache/superset/issues/28691#issuecomment-2129065622

   <!-- Answer -->
   The `superset fab list-users` command does not include the `firstname`, 
`lastname`, and `active` columns in its output because these columns are not 
specified in the `list_columns` attribute of the `UserModelView` class. The 
`list_columns` attribute determines which columns are displayed when listing 
users.
   
   To include the `firstname`, `lastname`, and `active` columns in the output, 
you need to modify the `UserModelView` class to specify these columns in the 
`list_columns` attribute. Here is an example of how you can do this:
   
   ```python
   from flask_appbuilder import ModelView
   from flask_appbuilder.security.sqla.models import User
   
   class CustomUserModelView(ModelView):
       datamodel = SQLAInterface(User)
       list_columns = ["id", "username", "firstname", "lastname", "active", 
"email"]
   
   appbuilder.add_view(
       CustomUserModelView,
       "List Users",
       icon="fa-user",
       label=_("List Users"),
       category="Security",
       category_icon="fa-cogs",
   )
   ```
   
   By adding the `firstname`, `lastname`, and `active` columns to the 
`list_columns` attribute, they will be included in the output of the `superset 
fab list-users` command 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset/security/manager.py)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   <details>
   <summary>
   
   #### Details
   </summary>
   
   **About Dosu**
   This response is meant to be useful and save you time. It is **not meant to 
be a precise solution**, but rather a starting point for your own research.
   
   Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is 
irrelevant.
   </details>
   
   *To continue the conversation, mention @dosu.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to