Re: [Zope] Variable sort in dtml-in

2000-07-14 Thread Adam Karpierz

In my search form, I have a selection box "in_sort_by" whose value can
be "Category", "Field", or "Title".  I am trying to make dtml-in sort by
this value.  I am using:

 dtml-in SQL_search sort="_['in_sort_by']" size=list_size
start=query_start

Hi Aaron again

I have attached appropriate patch for dtml-in tag for Zope 2.2.0b3/b4
(Of course this patch was checked and works ok).

Just for you, the syntax of my patch for dtml-in should be:

dtml-in SQL_search sort="expr:_['in_sort_by']" size=list_size start=query_start

or best and simply (and strict equivalent above):

dtml-in SQL_search sort="expr:in_sort_by" size=list_size start=query_start

I want extend my proposal to others attributes like eg. size:

dtml-in SQL_search sort="expr:in_sort_by"
  size="expr:REQUEST.user_list_size" 
start=query_start

It is possible easy extend other DTML tags through the same way  too,
but I dont know what other zopistas (especcially from DC)  thinks about this.

My syntax proposal is one which not caused serious comtatibility problems.
Eg. natural syntax attr="something" is treated (unfortunately) as attr=something
and therefore would not be adapt and apply for indirect lookup of attribute
without breaking of compatibility.

Very please all for comments.

--
Adam Karpierz
[EMAIL PROTECTED]



begin 666 DT_In.py
M(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C
M(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C#0HC( T*(R!:;W!E
M(%!U8FQI8R!,:6-E;G-E("A:4$PI(%9EG-I;VX@,2XP#0HC("TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2T-"B,@#0HC($-O'ER:6=H
M=" H8RD@1EG:71A;"!#F5A=EO;G,N("!!;P@FEG:'1S(')EV5R=F5D
M+@T*(R -"B,@5AIR!L:6-E;G-E(AAR!B965N(-EG1I9FEE9"!AR!/
M5N(%-O=7)C92AT;2DN#0HC( T*(R!2961IW1R:6)U=EO;B!A;F0@=7-E
M(EN('-O=7)C92!A;F0@8FEN87)Y(9OFUS+"!W:71H(]R('=I=AO=70-
M"B,@;6]D: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O;F4@=V%Y('1O
M(%SW5R92!T:%T(=R;W=T:"X-"B,@#0HC(#0N($%L;"!A9'9EG1IVEN
M9R!M871EFEA;',@86YD(1O8W5M96YT871I;VX@;65N=EO;FEN9PT*(R @
M("!F96%T=7)ER!D97)I=F5D(9R;VT@;W(@=7-E(]F('1H:7,@V]F='=A
MF4@;75S="!D:7-P;%Y#0HC(" @('1H92!F;VQL;W=I;F@86-K;F]W;5D
M9V5M96YT.@T*(R -"B,@(" @(" B5AIR!PF]D=6-T(EN8VQU95S('-O
M9G1W87)E(1E=F5L;W!E9"!B2!$:6=I=%L($-R96%T:6]NPT*(R @(" @
M(9OB!UV4@:6X@=AE(%H@3V)J96-T(%!U8FQIVAI;F@16YV:7)O;FUE
M;G0-"B,@(" @(" H:'1T#HO+W=W=RYZ;W!E+F]R9R\I+B(-"B,@#0HC(" @
M($EN('1H92!E=F5N="!T:%T('1H92!PF]D=6-T()E:6YG(%D=F5R=ES
M960@:6YC;'5D97,@86X-"B,@(" @:6YT86-T(%IO4@9ES=')I8G5T:6]N
M("AW:71H(-O'ER:6=H="!A;F0@;EC96YS92!I;F-L=61E9"D-"B,@(" @
M=AE;B!T:ES(-L875S92!IR!W86EV960N#0HC( T*(R U+B!.86UER!A
MW-O8VEA=5D('=I=@@6F]P92!OB!$:6=I=%L($-R96%T:6]NR!M=7-T
M(YO="!B92!UV5D('1O#0HC(" @(5N9]RV4@;W(@')O;6]T92!PF]D
M=6-TR!D97)I=F5D(9R;VT@=AIR!S;V9T=V%R92!W:71H;W5T#0HC(" @
M('!R:6]R('=R:71T96X@5R;6ESVEO;B!FF]M($1I9VET86P@0W)E871I
M;VYS+@T*(R -"B,@-BX@36]D:69I960@F5D:7-TFEB=71I;VYS(]F(%N
M2!F;W)M('=H871S;V5V97(@;75S="!R971A:6X-"B,@(" @=AE(9O;QO
M=VEN9R!A8VMN;W=L961G;65N=#H-"B,@#0HC(" @(" @(E1H:7,@')O9'5C
M="!I;F-L=61ER!S;V9T=V%R92!D979E;]P960@8GD@1EG:71A;"!#F5A
M=EO;G,-"B,@(" @("!F;W(@=7-E(EN('1H92!:($]B:F5C="!0=6)L:7-H
M:6YG($5N=FER;VYM96YT#0HC(" @(" @*AT=' Z+R]W=WNF]P92YOFO
M*2XB#0HC( T*(R @("!);G1A8W0@*')E+2ED:7-TFEB=71I;VYS(]F(%N
M2!O9F9I8VEA;"!:;W!E(')E;5AV4@9\@;F]T#0HC(" @(')E75IF4@
M86X@97AT97)N86P@86-K;F]W;5D9V5M96YT+@T*(R -"B,@-RX@36]D:69I
M8V%T:6]NR!AF4@96YC;W5R86=E9"!B=70@;75S="!B92!P86-K86=E9"!S
M97!AF%T96QY(%S#0HC(" @('!A=-H97,@=\@;V9F:6-I86P@6F]P92!R
M96QE87-ERX@($1IW1R:6)U=EO;G,@=AA="!D;R!N;W0-"B,@(" @8VQE
M87)L2!S97!AF%T92!T:4@%T8VAER!FF]M('1H92!OFEG:6YA;"!W
M;W)K(UUW0@8F4@8VQE87)L0T*(R @("!L86)E;5D(%S('5N;V9F:6-I
M86P@9ES=')I8G5T:6]NRX@($UO9EF:6-A=EO;G,@=VAI8V@@9\@;F]T
M#0HC(" @(-AG)Y('1H92!N86UE(%IO4@;6%Y()E('!A8VMA9V5D(EN
M(%N2!F;W)M+"!AR!L;VYG(%S('1H97D-"B,@(" @8V]N9F]R;2!T;R!A
M;P@;V8@=AE(-L875S97,@86)O=F4N#0HC( T*(R -"B,@1ES8VQA:6UE
M@T*(R 

Re: [Zope] Variable sort in dtml-in

2000-07-14 Thread Aaron Williamson

 I have attached appropriate patch for dtml-in tag for Zope 2.2.0b3/b4
 (Of course this patch was checked and works ok).

Thanks again for the patch.  It is a much needed option (and rather a glaring omission 
from
the original code).  So far it is working flawlessly for me.

 I want extend my proposal to others attributes like eg. size:

 dtml-in SQL_search sort="expr:in_sort_by"
   size="expr:REQUEST.user_list_size" 
start=query_start

Is this necessary?  I actually use a variable for size (size=list_size) in the same 
dtml-in,
and that part seems to work just fine.  Maybe mine is a special case, but I don't 
think so.

 It is possible easy extend other DTML tags through the same way  too,
 but I dont know what other zopistas (especcially from DC)  thinks about this.

I for one am for it.  The lack of multiple and variable sort keys in version 2.14 were 
a major
hindrance to me.  I am sure that many tags could benefit from similar improvements.

Thanks again,

Aaron


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Variable sort in dtml-in

2000-07-13 Thread Aaron Williamson

In my search form, I have a selection box "in_sort_by" whose value can
be "Category", "Field", or "Title".  I am trying to make dtml-in sort by
this value.  I am using:

 dtml-in SQL_search sort="_['in_sort_by']" size=list_size
start=query_start

And I've tried other variations, but I always get an attribute error.
The strange thing to me is that list_size is also a variable and it
works fine, but I've tried just using in_sort_by and that doesn't work.
What am I missing here?

Many thanks,

Aaron


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Variable sort in dtml-in

2000-07-13 Thread Bill Anderson

Aaron Williamson wrote:
 
 In my search form, I have a selection box "in_sort_by" whose value can
 be "Category", "Field", or "Title".  I am trying to make dtml-in sort by
 this value.  I am using:
 
  dtml-in SQL_search sort="_['in_sort_by']" size=list_size
 start=query_start
 
 And I've tried other variations, but I always get an attribute error.
 The strange thing to me is that list_size is also a variable and it
 works fine, but I've tried just using in_sort_by and that doesn't work.
 What am I missing here?

http://www.zope.org/Documentation/How-To/index_html/view_source

should give you some ideas...

--
Do not meddle in the affairs of sysadmins, for they are easy to annoy,
and have the root password.

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )