logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Fixed: "Ordered By" bug: msg#00005

Subject: Re: Fixed: "Ordered By" bug
En/na Nils Kassube ha escrit:

Here's a patch for the "Order by" bug reported in

http://sourceforge.net/tracker/index.php?func=detail&aid=931962&group_id=87538&atid=583488

Obviously you also need to rebuild all your table manager objects, i.e.

for x in context.objectValues('zetadb table manager'):
 print x.zetadb_man_build_objects(RESPONSE=None)

nika-/qQEVZGChKg@xxxxxxxxxxxxxxxx:~/data/projects/rts/playinstance/Products/zetadb>
 diff zetadb_script.py zetadb_script.py_orig
208,209c208,209
<         body += """if p_request.has_key('%s_order_by'):\n""" % table_name
<         body += """  request.%s['%s_order_by'] = 
p_request['%s_order_by']\n""" % (session_name, table_name, table_name)
---
       body += """if p_request.has_key('order_by'):\n"""
       body += """  request.%s['order_by'] = p_request['order_by']\n""" % 
session_name
211,212c211,212
<         body += """if not(request.%s.has_key('%s_order_by')):\n""" % 
(session_name, table_name)
<         body += """  request.%s['%s_order_by'] = \"""%s\"""\n""" % 
(session_name, table_name, default_order)
---
       body += """if not(request.%s.has_key('order_by')):\n""" % session_name
       body += """  request.%s['order_by'] = \"""%s\"""\n""" % (session_name, 
default_order)
215,216c215
<         body += """if request.%s['%s_order_by']:\n""" % (session_name, 
table_name)
<         body += """  kw['p_order_by'] = ' order by ' + 
request.%s['%s_order_by']\n""" % (session_name, table_name)
---
       body += """kw['p_order_by'] = ' order by ' + request.%s['order_by']\n""" 
% session_name
532c531
<         body += """current_order = request.%s['%s_order_by']\n""" % 
(session_name, table_name)
---
       body += """current_order = request.%s['order_by']\n""" % session_name

Based on the first impression, it seems to work.
Sorry for the silent about the bug. I've been working in another projects and zetadb is now in stand by. Thanks a lot for the patch. It seems to be OK. I have a little problem to apply it due to some character transformation of the mail. Could you please send it as an attachment ? I will apply it and commit it into CVS.

Thanks again

Santi Camps








-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297


<Prev in Thread] Current Thread [Next in Thread>