SQLAlchemy 查询后访问@property

问题描述

如果我在 sqlAlchemy 中有两个模型:

    $products = wc_get_product( $product_id );
    
    $nonwh = $product->get_attribute('nonwh'); 
    
        if( ! empty( $nonwh ) ){
            
// Do nothing if product has the nonwh attribute

        } else {
        //Show Products
    }

我执行了一个连接查询,例如

class Person(): 
  person_id = db.Column(db.Integer)

class Student()
  student_id = db.column(db.Integer)

  @property
  def returnExample(self): 
    return 'Example string'

如何访问 Student 的属性装饰器?

results = Person.query.join(Student).all()

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)