It must be me being new to Python (and web2py) but I can't seem to get
this to work, plus I think creating a whole new class and
instantiating and object for something this simple is a bit of
overkill (maybe I'm wrong)...

Where does web2py include its html.py and provide access to those
functions? If I could see that code I can review it and probably learn/
understand how to accomplish what I am looking for much easier than
asking you for step-by-step.

On Mar 9, 11:09 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> class YourHelper(DIV):
>     tag='code'
>     def __init__(self,*components,**attributes):
>          self.components,self.attributes=components,attributes
>     def xml(self): return serial representation
>
> On Mar 9, 6:07 pm, Michael Wales <evicera...@gmail.com> wrote:
>
> > What is the standard way to go about creating your ownviewhelpers? I
> > would like to wrap a content area within a word_limiter() method but
> > not sure what the community standard practice is in accomplishing
> > this.
>
> > <code>def word_limiter(content, limit = 100, suffix = '...'):
> >   if len(content) <= limit:
> >     return content
> >   else:
> >     return content[:limit].rsplit(' ', 1)[0] + suffix</code>
>
> > Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to