feat: add author_name for app list card (#16900)
Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
parent
2cad98f01f
commit
6f982eb7e4
4 changed files with 30 additions and 7 deletions
|
|
@ -100,6 +100,8 @@ app_partial_fields = {
|
|||
"updated_at": TimestampField,
|
||||
"tags": fields.List(fields.Nested(tag_fields)),
|
||||
"access_mode": fields.String,
|
||||
"create_user_name": fields.String,
|
||||
"author_name": fields.String,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -294,6 +294,15 @@ class App(Base):
|
|||
|
||||
return tags or []
|
||||
|
||||
@property
|
||||
def author_name(self):
|
||||
if self.created_by:
|
||||
account = db.session.query(Account).filter(Account.id == self.created_by).first()
|
||||
if account:
|
||||
return account.name
|
||||
|
||||
return None
|
||||
|
||||
|
||||
class AppModelConfig(Base):
|
||||
__tablename__ = "app_model_configs"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue