[Grok-dev] megrok.rdb: composite primary keys

Santiago Videla santiago.videla at gmail.com
Thu Apr 2 21:07:18 EDT 2009


I guess that this is a question for Martijn but maybe somebody else could
help me...

I'm trying to define a rdb.Model with a composite primary key and I discover
this piece of code in megrok.rdb.components.py

def default_keyfunc(node):
    primary_keys = node.__table__.primary_key.keys()
    if len(primary_keys) == 1:
        return getattr(node, primary_keys[0])
        raise RuntimeError(
            "don't know how to do keying with composite primary keys")

The question is: there are any hints to find out how to do it? where should
I start looking?

Best Regards

Santiago Videla

Sigue la mata dando de que hablar siempre abajo y a la izquierda donde el
pensamiento que se hace corazón resplandece con la palabra sencilla y
humilde que l at s tod at s somos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20090402/55973ab4/attachment.html 

More information about the Grok-dev mailing list