Re: [Modeling-users] using Modeling w/o primary keys
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2004-06-28 16:44:29
|
Hi Duncan, Does this mean that you need to access an already existing database where *no* primary key are defined??? PKs are important, yes, just because you need a PK to map an object w/ its corresponding row in the database (even if you do not have a single relationship defined in the schema). Any objkect-relational mapper will need a way to uniquely identify a row/an object (it does not mean, however, that there should be an attribute explictely marked as the PK in the db, only there is exists a set of attributes (generally one) that can be taken as the PK). I bet you have PK defined in your tables, or am I wrong? Secondly, could you tell whether you wish read-only access to the db? (I suspect you do, but better be sure). -- Sébastien. Duncan McGreggor <py...@ad...> wrote: > Hey folks, > > I've got kind of an insane question... insane because Modeling is so > good, and I have a need to use it in a very limited fashion. > > One of my clients wants to rollout support for Modeling in their python > applications, but wants to do it without support for primary keys. The > reason for this is that they are pulling meta-data out of databases > (i.e., basic column definitions for tables) but not anything regarding > relationships. They want to create attributes/properties of entities > based on this, and then use these models to programmatically manipulate > live data in the database. > > Is using Modeling w/o support for primary keys possible? I have been > trying to do something like this, but it violates rules for valid > models in Modeling, and as such, it won't create any .py package model > files. My attempts at tweaking the code to disable support for PKs have > been catastrophic, as it seems it is woven into the very fabric of the > software. Is there a crazy hack I can use until the client is ready to > support primary keys in the meta-data extraction process? > > Thanks for any help or advice! > > Duncan |