473,408 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Pythonic ORM with support for composite primary/foreign keys?

Hello,

so far it seems to me as if the only ORM module for Python which
supports composite primary/foreign keys was SQLAlchemy. Which looks a
little bit "overbloated" for my needs: I "just" need to be able to
define a "logical model" (à la UML) in Python and have the ORM connect
to a database (running on PostgreSQL in my case) which uses a
corresponding (pre-defined) "physical model" as its schema.

Modeling really does look exactly like what I need. Among others, it
seems to be understandable even for a Clueless Python Scripting
Dilettant like me. But support for primary keys is not yet completely
built-in (and tested).

So, is there another ORM module for Python besides SQLAlchemy which
supports composite porimary (and foreign) keys, and maybe also other
more "advanced", maybe even some of the PostgreSQL-specific features
(such as e.g. composite types)?

TIA,

Sincerely,

Wolfgang Keller
Nov 6 '07 #1
4 2950
Wolfgang Keller wrote:
so far it seems to me as if the only ORM module for Python which
supports composite primary/foreign keys was SQLAlchemy. Which looks a
little bit "overbloated" for my needs: I "just" need to be able to
define a "logical model" (à la UML) in Python and have the ORM connect
to a database (running on PostgreSQL in my case) which uses a
corresponding (pre-defined) "physical model" as its schema.
I think if your model is complex enough that you need composite foreign
keys, the project might deserve SQLAlchemy.

Mapping a bunch of python classes to an efficient DBMS schema is not
easy by any definition of "easy".

Google for "orm vietnam"... it might also be useful to read "The Art of
SQL" even if you don't plan to write SQL by hand.

Nov 6 '07 #2
Django has a wonderful ORM that can be used separately from the
framework, but it is pretty top-heavy as well. I'm afraid that size
is the price you pay for abstraction. Your business logic code
shrinks, but the supporting libraries grow.

Nov 6 '07 #3
On Nov 6, 8:29 am, Jeff <jeffo...@gmail.comwrote:
Django has a wonderful ORM that can be used separately from the
framework, but it is pretty top-heavy as well. I'm afraid that size
is the price you pay for abstraction. Your business logic code
shrinks, but the supporting libraries grow.
But the OP specifically asked for composite keys, which Django's ORM
does not support.

....
Jay

Nov 6 '07 #4
jay graves wrote:
On Nov 6, 8:29 am, Jeff <jeffo...@gmail.comwrote:
>Django has a wonderful ORM that can be used separately from the
framework, but it is pretty top-heavy as well. I'm afraid that size
is the price you pay for abstraction. Your business logic code
shrinks, but the supporting libraries grow.

But the OP specifically asked for composite keys, which Django's ORM
does not support.
SQLAlchemy is the way to go, for his use case. If he wants a
more concise and easier to use syntax, he can install Elixir
(http://elixir.ematia.de), which makes things look a bit more familiar.

Elixir does support composite primary keys.

--
Jonathan LaCour
http://cleverdevil.org

Nov 6 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Girish Agarwal | last post by:
Hi All, I have a database consisting of 2 tables. patient_info ( Patient Information ).Looks like lastname VARCHAR(10) fname VARCHAR(10) ssno INT(9) PRIMARY KEY ID INT(4) AUTO_INCREMENT ...
6
by: Andreas | last post by:
Hello list, what about uniqueness of inherited primary keys ? eg you have : create table objects ( id int4, date_created timestamp(0), primary key (id)
18
by: Thomas A. Anderson | last post by:
I am a bit confused in creating a composite primary key. I have three table with two of the tables containing primary keys. I have two of the tables (each with a primary key) having one to many...
4
by: Ismail Rajput | last post by:
Is there any option we can use Composite DataKeyField in the DataList and DataGrid?
4
by: Kenneth McDonald | last post by:
I need to do some data manipulation, and SQLite is a nice little product for it, except of course that I'd need to write SQL. Are there any good libraries out there that let one write (basic)...
2
by: bobby_b_ | last post by:
I have a table where fields 1 and 2 make up the primary key. Because of this, I have a unique composite index on fields 1 and 2 (as required by DB2). Now my question is: Fields 1 and 2 are also...
6
by: mac | last post by:
Summary: 1. I want to define a column in anMS Access table to be lookups on other tables. 2. The table that is the data source (e.g the "parent" table) has a composite primary key. 3. When...
7
by: Ronald S. Cook | last post by:
My client manager likes concatenated/composite primary keys. I don't. Can anyone forward any arguments pro or con? Thanks, Ron
1
by: mallz | last post by:
hi, i have two tables: table1: mid,name table2: mid,did,location now, i need to increment against a particular mid value.... how can that be done? please help.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.