I would like to subclass a Row object but cant get it right. What would be 
the way? 

from pydal.objects import Row

class Hotel(Row):
    _room_types = None
    _regimen_types = None
    _agencies = None
    _countries = None

    def __init__(self, db, id):
        super(Hotel, self).__init__()
        self = db.hotels[id]
    
    @property
    def agencies(self):
        self._agencies = self._agencies or db(db.hotels.id == self.id).
select(db.agencies.ALL, join=db.hotels.on(db.hotels.id == db.agencies.hotel
))
        return self._agencies

Thanks

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to