many-to-many relationship and sorting
[prev]
[thread]
[next]
[Date index for 2005/03/08]
This is a multi-part message in MIME format.
------_=_NextPart_001_01C523F6.5781AEFC
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
Hi list!
I use the many-to-many relationship as explained here:
http://search.cpan.org/dist/Class-DBI/lib/Class/DBI.pm#MANY_TO_MANY_RELA
TIONSHIPS
What I'd need is to sort the returned objects by their name field.
Is this currently supported?
If yes how is the syntax?
=20
I use this syntax:
Actor->has_many(films =3D> [ Role =3D> 'film' ]);
=20
Without the mapping sorting is supported:
Music::CD->has_many(tracks =3D> 'Music::Track', { order_by =3D> 'playorde=
r'
});
=20
-Alex
=20
=20
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*"*
Hinweis: Dieses E-mail kann vertrauliche und gesch=FCtzte Informationen e=
nthalten.
Sollten Sie nicht der beabsichtigte Empf=E4nger sein, verst=E4ndigen Sie =
bitte den Absender und l=F6schen Sie dieses E-mail dann sofort.
Notice: This e-mail contains information that is confidential and may be =
privileged.
If you are not the intended recipient, please notify the sender and then =
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*"*
------_=_NextPart_001_01C523F6.5781AEFC
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-mi=
crosoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:wo=
rd" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";}
pre
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3DDE link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>Hi list!<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>I use the many-to-many relationship as explaine=
d
here: <a
href=3D"http://search.cpan.org/dist/Class-DBI/lib/Class/DBI.pm#MANY_TO_MA=
NY_RELATIONSHIPS">http://search.cpan.org/dist/Class-DBI/lib/Class/DBI.pm#=
MANY_TO_MANY_RELATIONSHIPS</a><o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>What I’d need is to sort the returned obj=
ects
by their name field.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>Is this currently supported?<o:p></o:p></span><=
/font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>If yes how is the syntax?<o:p></o:p></span></fo=
nt></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>I use this syntax:<o:p></o:p></span></font></p>=
<pre><font size=3D2 face=3D"Courier New"><span lang=3DEN-GB style=3D'font=
-size:10.0pt'>Actor->has_many(films =3D> [ Role =3D> 'film' ]);<=
o:p></o:p></span></font></pre>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>Without the mapping sorting is supported:<o:p><=
/o:p></span></font></p>
<pre><font size=3D2 face=3D"Courier New"><span lang=3DEN-GB style=3D'font=
-size:10.0pt'>Music::CD->has_many(tracks =3D> 'Music::Track', { ord=
er_by =3D> 'playorder' });<o:p></o:p></span></font></pre>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<div>
<p class=3DMsoPlainText><font size=3D2 face=3DArial><span lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial'>-Alex<o:p></o:p></span></fon=
t></p>
</div>
<p><font size=3D2 face=3DArial><span lang=3DEN-GB style=3D'font-size:10.0=
pt;font-family:
Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span lang=3D=
EN-GB
style=3D'font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
<br>*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*"*"*"*<br>Hinweis: Dieses E-mail kann vertrauliche und gesch=FCtzte Inf=
ormationen enthalten.<br>Sollten Sie nicht der beabsichtigte Empf=E4nger =
sein, verst=E4ndigen Sie bitte den Absender und l=F6schen Sie dieses E-ma=
il dann sofort.<br><br>Notice: This e-mail contains information that is c=
onfidential and may be privileged.<br>If you are not the intended recipie=
nt, please notify the sender and then delete this e-mail immediately.<br>=
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*"*</body>
</html>
------_=_NextPart_001_01C523F6.5781AEFC--
|
(message missing)
|
|
|
many-to-many relationship and sorting
Hartmaier Alexander 15:48 on 08 Mar 2005
|