Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
paginação n:n
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nicássio Meneguci  
View profile   Translate to Translated (View Original)
 More options Jun 23, 9:27 pm
From: Nicássio Meneguci <nicassio.meneg...@gmail.com>
Date: Tue, 23 Jun 2009 18:27:30 -0700 (PDT)
Local: Tues, Jun 23 2009 9:27 pm
Subject: paginação n:n
Estou com um problema para fazer uma paginacao aplicando um filtro na
tabela telefones, no campo telefone

quando uso o método paginator, ele me retorna um erro dizendo que nao
encontrou o campo, e mostra o select, nele eu reparei que nao faz o o
left join na tabela telefones, somente na tabela agendas_telefones, eu
ja consegui fazer o relacionamento entre elas, pra me mostrar os
dados, mas quando uso o paginator
com a condicação não está dando certo.
alguem poderia me ajudar
segue a estrutura das tabelas:
obrigado
CREATE TABLE IF NOT EXISTS `agendas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agenda` varchar(60) NOT NULL,
  `prioridade` int(11) NOT NULL DEFAULT '0',
  `agendanatureza_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
AUTO_INCREMENT=3 ;
INSERT INTO `agendas` (`id`, `agenda`, `prioridade`,
`agendanatureza_id`) VALUES
(1, 'Loja de Armas do Beto', 1, 1),
(2, 'Cristal', 3, 2);

CREATE TABLE IF NOT EXISTS `agendas_telefones` (
  `agendas_id` int(11) NOT NULL,
  `telefones_id` int(11) NOT NULL,
  PRIMARY KEY (`agendas_id`,`telefones_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `agendas_telefones` (`agendas_id`, `telefones_id`) VALUES
(1, 1),
(1, 2),
(2, 1),
(2, 2);
CREATE TABLE IF NOT EXISTS `telefones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `telefone` varchar(13) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
INSERT INTO `telefones` (`id`, `telefone`) VALUES
(1, 'aaaaaaaaaaaaa'),
(2, 'aaaaaaaaaaaaa');


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Altieres  
View profile   Translate to Translated (View Original)
 More options Jun 27, 2:46 pm
From: Altieres <altiereslo...@gmail.com>
Date: Sat, 27 Jun 2009 11:46:12 -0700 (PDT)
Local: Sat, Jun 27 2009 2:46 pm
Subject: Re: paginação n:n
Nicássio,

Pelo que entendi você está fazendo find na tabela Agenda.
Se você está fazendo buscas por telefones, seus finds deviam ser na
model Telefone. Acredito que devia ser a action index da controller
Telefones.

De qualquer forma, você pode tentar mudar a model que o paginator está
usando, para a Telefone, da seguinte maneira:

$this->paginate('Telefone');

Se precisar exibir dados da agenda, faça um Telefone belongsTo Agenda
e recupere os dados necessários...

att,

---
Altieres Lopes
WebGoal.com.br
Simplificando Softwares

On 23 jun, 22:27, Nicássio Meneguci <nicassio.meneg...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google