コード例 #1
0
 public function testIssue20_2()
 {
     $filter = ['model_tyre__name' => 'Nordman 4'];
     $qs = Tyre::objects()->getQuerySet()->filter($filter);
     $data = $qs->with(['model_tyre'])->asArray()->all();
     $this->assertEquals([['model_tyre' => ['id' => 1, 'name' => 'Nordman 4', 'tyre_id' => 1], 'id' => 1, 'tyre_id' => 1]], $data);
 }
コード例 #2
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className()], 'tyre' => ['class' => ForeignField::className(), 'modelClass' => Tyre::className()]];
 }