[BioSQL-l] Python ORM mapping for BioSQL

Peter biopython at maubp.freeserve.co.uk
Fri Nov 28 16:57:47 UTC 2008


>> I investigated Django earlier this month, and rejected it because it
>> doesn't yet support multi-column indices as primary keys.  They've had
>> an open bug on this for 3 years, with no expected date yet:
>> http://code.djangoproject.com/wiki/MultipleColumnPrimaryKeys
>> http://code.djangoproject.com/ticket/373
>>
>> My impression is that Django's philosophy is that they expect you to
>> define your objects which then automatically defines the database
>> schema.  Note the title of this FAQ page refers to an existing schema
>> as a "legacy" database:
>> http://docs.djangoproject.com/en/dev/howto/legacy-databases/
>> If Django can cope with an existing schema, then it does look like an
>> excellent package, and seems well documented.
>
> You can still use Django even if you don't want to modify your database,
> with the caveat that certain functions (e.g. adding a new taxon via the ORM)
> will not work correctly. If you are just querying data that still might be
> sufficiently useful.

Maybe - but given so much of BioSQL uses composite primary keys etc it
was my impression that trying to use Django would be making life
difficult for myself.  If you already are familiar with Django, then
perhaps this wouldn't be so bad.

> I wouldn't make an argument to change BioSQL to suit Django, ...

Agreed.

> ... but I would commend Django to anyone using Python who wants an
> ORM - particularly if they are building a dynamic web site!

I agree but ONLY if you are not trying to use an existing schema with
composite primary keys and/or tables with no primary key.  For these
SQLAlchemy seems to be the current best bet with python, leading to
the choice of either TurboGears (which I went for) or Pylons (picked
by Brad).

Peter



More information about the BioSQL-l mailing list