Re: Patch for webhelpers/pagination/orm.py to raise proper exception

2007-02-01 Thread Shannon -jj Behrens

On 1/31/07, Christoph Haas [EMAIL PROTECTED] wrote:

 On Wednesday 31 January 2007 09:12, Daniel Néri wrote:
  Note that raising of strings as exceptions is deprecated in Python
  2.5[*] and triggers a warning.

 Thanks for the pointer. I already wondered why some people already use
 '''raise Exception, blah blah'''

I'm guessing that this is what you want in this case:

raise ValueError(msg...)

 I currently attempt to rewrite the paginator anyway and hope to come up
 with more than this trivial patch. Last evening I used to learn about
 partials and closures. Today the real work continues. :)

Curry is good, partial is better, and closures are *the bomb*!

-jj

-- 
http://jjinux.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Patch for webhelpers/pagination/orm.py to raise proper exception

2007-01-31 Thread Christoph Haas

On Wednesday 31 January 2007 09:12, Daniel Néri wrote:
 Note that raising of strings as exceptions is deprecated in Python
 2.5[*] and triggers a warning.

Thanks for the pointer. I already wondered why some people already use
'''raise Exception, blah blah'''

I currently attempt to rewrite the paginator anyway and hope to come up 
with more than this trivial patch. Last evening I used to learn about 
partials and closures. Today the real work continues. :)

 Christoph

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Patch for webhelpers/pagination/orm.py to raise proper exception

2007-01-30 Thread Ben Bangert

On Jan 30, 7:11 am, Christoph Haas [EMAIL PROTECTED] wrote:
 The webhelpers.pagination.paginate call fails miserably if an object
 is given as the first parameter that is a proper SQLObject class or
 SQLAlchemy query. The error message was You shouldn't have this
 which doesn't tell the user what went wrong. And the error was
 even passed back and displayed on the web page. So I thought raising
 an exception might be a better way. Proposal

Yep, this is definitely a nicer message and makes it hard to miss if
something goes wrong. I've merged this patch in the latest svn of
WebHelpers. Thanks!

- Ben


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---