Re: [Catalyst] DBIx question
Len Jaffe [EMAIL PROTECTED] wrote on 08/26/2007 12:03:49 PM: On 8/25/07, Matt S Trout [EMAIL PROTECTED] wrote: You're a programmer for a living. You can figure out how to work a mailing list. Stop mollycoddling the new guys! =) I do take this as sarcasm -- the ironic part is that if you search Will Smith in archives you will see that even at this level he is pampering. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] DBIx question
On 8/25/07, Matt S Trout [EMAIL PROTECTED] wrote: You're a programmer for a living. You can figure out how to work a mailing list. Stop mollycoddling the new guys! -- [EMAIL PROTECTED] 614-404-4214 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] DBIx question
On Fri, Aug 24, 2007 at 07:57:50AM -0700, Will Smith wrote: Hi, I know this is not the room for DBIx, I tried to post in DBIx, but did not go through, so, if you don't mind, please do not bounce me out. Then you need to try and subscribe again, and if that doesn't work you mail the list administrator, which incidentally is me. You're a programmer for a living. You can figure out how to work a mailing list. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical DirectorWant a managed development or deployment platform? Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] DBIx question
Will Smith wrote: Hi, I know this is not the room for DBIx, I tried to post in DBIx, but did not go through, so, if you don't mind, please do not bounce me out. my question is: I have a multiple join, and trying to sort the dataset using oder_by, and get either error, or do not sort. my code is: # table: calls,property,city . property has many calls, city has many property, calls belong to property, property belong to city my $rs = [$c-model('myappDB::City')-search( { 'calls.CallerID' = '1', 'calls.CallStatusID' = '0' }, { order_by = 'city.CityName' }, { join = { 'property' = 'calls' } } )]; How can I sort by CityName ? Thank you. Looks like you have too many hashrefs there, and the city table is called me because it's the main table you're searching in. Try it like this: my $rs = [$c-model('myappDB::City')-search( { 'calls.CallerID' = '1', 'calls.CallStatusID' = '0' }, { order_by = 'me.CityName', join = { 'property' = 'calls' }, } )]; Matt ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] DBIx question
Good morning, On 24/8/07 at 7:57 AM -0700, Will Smith [EMAIL PROTECTED] wrote: I have a multiple join, and trying to sort the dataset using oder_by, and get either error, or do not sort. my code is: # table: calls,property,city . property has many calls, city has many property, calls belong to property, property belong to city my $rs = [$c-model('myappDB::City')-search( { 'calls.CallerID' = '1', 'calls.CallStatusID' = '0' }, { order_by = 'city.CityName' }, { join = { 'property' = 'calls' } } )]; How can I sort by CityName ? Have you tried: order_by = 'me.CityName' The 'base' table is aliased as 'me'. Charlie -- Charlie Garrison [EMAIL PROTECTED] PO Box 141, Windsor, NSW 2756, Australia O ascii ribbon campaign - stop html mail - www.asciiribbon.org http://www.ietf.org/rfc/rfc1855.txt ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] DBIx question
Thank you all, it works. Matt Lawrence [EMAIL PROTECTED] wrote: Will Smith wrote: Hi, I know this is not the room for DBIx, I tried to post in DBIx, but did not go through, so, if you don't mind, please do not bounce me out. my question is: I have a multiple join, and trying to sort the dataset using oder_by, and get either error, or do not sort. my code is: # table: calls,property,city . property has many calls, city has many property, calls belong to property, property belong to city my $rs = [$c-model('myappDB::City')-search( { 'calls.CallerID' = '1', 'calls.CallStatusID' = '0' }, { order_by = 'city.CityName' }, { join = { 'property' = 'calls' } } )]; How can I sort by CityName ? Thank you. Looks like you have too many hashrefs there, and the city table is called me because it's the main table you're searching in. Try it like this: my $rs = [$c-model('myappDB::City')-search( { 'calls.CallerID' = '1', 'calls.CallStatusID' = '0' }, { order_by = 'me.CityName', join = { 'property' = 'calls' }, } )]; Matt ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ - Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/