Access Model Attribute With Two Relation.

I have a problem while sorting model attribute that we are displaying with two relations.

$sort = new CSort;

            $sort->attributes = array(


                            'asc' => '',

                            'desc' => ' DESC'




            return new CActiveDataProvider($this, array(




this works fine it has only one relation client.

but when i have two relation,


                            'asc' => 'Subscription.project.p_name',

                            'desc' => 'Subscription.project.p_name DESC'


where Subscription and project are relations.How can i do this one??

Here i have one model StudentTransaction in it this code is define, and i want to get cityname throught it in desc order.

here in this model Rel_Student_Address(relation) is define which refer to StudentAddress Model

then in my StudentAddress Model Rel_c_city(relation) is defines which refer City Model

may this following code which is work for me can help you to solve your problem

$stud_data = new CActiveDataProvider($this, array(





              		        'desc'=>'Rel_Student_Address.Rel_c_city.city_name DESC',




		)); !!!