Why not...
define_table('post', Field('title'), Field('content', 'text'))
class Post(object):
@staticmethod
def get_permalinkI(post):
return URL(slugify(post.title))
Then just
for post in db().select(db.post.ALL):
print Post.get_permalink(post)
--
Thadeus
On Thu, May 13, 2010 at 1:44 AM, vihang <[email protected]> wrote:
> Maybe we could inherit in some way, but I need to inherit a bunch.
> Hence it does not help.
>
> On May 12, 8:08 pm, Thadeus Burgess <[email protected]> wrote:
>> VirtualFields?
>>
>> --
>> Thadeus
>>
>> On Tue, May 11, 2010 at 11:59 PM, vihang <[email protected]> wrote:
>> > Some of the apps I am working currently are much more easy to build if
>> > the models can be defined as a class with methods that act on them.
>>
>> > On May 12, 5:51 am, Álvaro Justen <[email protected]> wrote:
>> >> On Tue, May 11, 2010 at 21:38, Richard <[email protected]> wrote:
>> >> > there was a discussion about this on the developers mailing list last
>> >> > week:
>> >> >http://groups.google.com/group/web2py-developers/browse_thread/thread...
>>
>> >> Yes, started by me.
>>
>> >> > On May 7, 12:50 am, vihang <[email protected]> wrote:
>> >> >> Hello,
>>
>> >> >> A long time back, someone (mostly probably massimo) had written a few
>> >> >> lines of code showing how DAL could be extended to be used in class,
>> >> >> and effective like ORM. I have spent a lot of time searching for this
>> >> >> on this group, but unable to find it. Any help would be appreciated.
>>
>> >> vihang, why do you want an ORM? :)
>>
>> >> >> Thanks
>> >> >> Vihang
>>
>> >> --
>> >> Álvaro Justen - Turicas
>> >> http://blog.justen.eng.br/
>> >> 21 9898-0141
>