Re: Some more corrections to the documentation (manual) and some questios

Sebastien Bigaret <[email protected]> 25 Feb 2004 21:38:29 +0100
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
        Hi ,

"Ernesto Revilla" <[email protected]> wrote:
> Question: in secion 2.4.8 Association, in the 'Important' part it says:
> Association objects always define a to-one association from the first entity to the second entity, and an inverse to-many relationship from the second entity to the first one.
> 
> Is this true, although the multiplicity has no be defined as:
>               multiplicity=[ [0, 1], [0, None] ],
> like
>               multiplicity=[ [0, None], [0, 1] ],
> 
> ?

Yes, this is true, if you try to inverse toOne/toMany multiplicities
you'll get a "ValueError: invalid multiplicity dst->src: should be
toMany"

> 
> If the foreign key value must not be null, e.g. like the 'customer' field . for invoices, orders, etc., the multiplicity would be:              [1, 1], [0, None]
> as in:
>     Association('Invoice', 'Customer', relations=['customer','invoices'],
>                 multiplicity=[ [1, 1] , [0, None] ],
>                 delete=['nullify','deny'])
> ??

Right: a lower bound==1 requires any invoice to have exactly one customer.

> Generation of DB-Schema with mdl_generate_DB_schema.py:
> When I do:
>     python p:mdl_generate_DB_schema.py -c -v -C modelo.py
> 
> I get:
>     Error: option -C requires --admin-connection-dict
> 1.) I don't access the DB (-c option) so a admin dictionary should not be needed.
> 2.) there is no --admin-connection-dict parameter, only a --admin-dsn parameter

  You're absolutely right --for both the typo. and the fact that we
should probably just issue a warning if -c is set while --admin-dsn
would be required without -c.


  And thank you for the doc. corrections and the enhancement proposal.
  I'll look at them closely this week-end and integrate the corrections
  then. Thanks again.

-- Sébastien.




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click