davidm | 26 Jun 05:37

metakit relational questions


Hi,

I worked out how to do nested views (from trawling through list
archives, it isn't mentioned in the python documentation) - this is
great for emulating a simple SQL join.

But how do you do two tables that relate to each other?

For example, imagine one table called 'Director' which has the
columns:
 - name (string)
 - age (int)
 - companies (related join to Company)

and another table called 'Company', which has the columns:
 - name (string)
 - directors (related join to Person)

The situation is that each person, represented by a row in Director,
could be a director of more than one company, and each company would
often have two or more directors.

I'm familiar with SQLObject, where this can be very easily
accomplished with 'RelatedJoin' column types.

But is there a way to do this in Metakit? For example, given a person,
look up the list of companies of which s/he is a director, and for a
company, look up the list of directors?

(Continue reading)

Riccardo Cohen | 26 Jun 09:12

Re: metakit relational questions


in the page http://support.articque.com/metakit/metakit_tutorial.html
you will find a small example of relation

davidm wrote:
> Hi,
> 
> I worked out how to do nested views (from trawling through list
> archives, it isn't mentioned in the python documentation) - this is
> great for emulating a simple SQL join.
> 
> But how do you do two tables that relate to each other?
> 
> For example, imagine one table called 'Director' which has the
> columns:
>  - name (string)
>  - age (int)
>  - companies (related join to Company)
> 
> and another table called 'Company', which has the columns:
>  - name (string)
>  - directors (related join to Person)
> 
> The situation is that each person, represented by a row in Director,
> could be a director of more than one company, and each company would
> often have two or more directors.
> 
> I'm familiar with SQLObject, where this can be very easily
> accomplished with 'RelatedJoin' column types.
> 
(Continue reading)


Gmane