Well, actually I need only a tiny subset of a ORM. Or perhaps what I
need isn't exactly an ORM, because I have only one kind of Object with
a various number of Fields on a separate Table, so I was looking to
create something that could fit this scheme and nothing more, but I see
in any case it need
Fredp wrote:
(snip)
> I have something like a simple ORM which objects haven't a fixed number
> of fields, and I need to have properties (or methods) for each of them,
dumbiest possible example, but this should het you started
class Field(object):
# dummy
def __init__(self, **kw):
self._
Larry Bates wrote:
> Fredp wrote:
>
>>Hi
>>I was wondering if it is possible to have the various magic methods,
>>mainly __getattr__ and __setattr__, and @property attributes called
>>when accessing the attribute of a non-intantiated class.
>>
>>Imagin something like this:
>>#
>>class MyClass:
Larry Bates ha scritto:
> Fredp wrote:
> > Hi
> > I was wondering if it is possible to have the various magic methods,
> > mainly __getattr__ and __setattr__, and @property attributes called
> > when accessing the attribute of a non-intantiated class.
> >
> > Imagin something like this:
> > #
Fredp wrote:
> Hi
> I was wondering if it is possible to have the various magic methods,
> mainly __getattr__ and __setattr__, and @property attributes called
> when accessing the attribute of a non-intantiated class.
>
> Imagin something like this:
> #
> class MyClass:
> @property
>
Hi
I was wondering if it is possible to have the various magic methods,
mainly __getattr__ and __setattr__, and @property attributes called
when accessing the attribute of a non-intantiated class.
Imagin something like this:
#
class MyClass:
@property
def prop(self):
print