hello.

my webapp has 3 models:

Order, Item and Customer

Order belongsTo Item
Order belongsTo Customer

both OrderModel and ItemModel are in app's models dir.
CustomerModel is located in an external dir, defined in
bootstrap.php's app build

here's a piece of my OrdersController

class OrdersController extends AppController {
   [...]
   var $paginate = array(
      "limit" => 20,
      "contain" => array(
         "Item",
         "Customer"
      ),
      "order" => "Order.Code"
   )

   function index() {
      $this->set("orders", $this->paginate("Order"));
   }
}

and here's a piece of my Orders index

[...]
<th><?php echo $paginator->sort("Order code", "Order.code") ?></th>
<th><?php echo $paginator->sort("Customer", "Customer.name") ?></th>
[...]

if i click on "Order code" the page will work correctly and data will
be displayed sorted by Order.Code
if i click on "Customer" the page will return an error like "SQL
Error: 1054: Unknown column 'Customer.name' in 'order clause'"

i can't figure out the reason of this error...

CustomerModel and CustomersController are working ok. i can insert/
update/delete without errors.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to