[BioSQL-l] Python ORM mapping for BioSQL

Nick Loman n.j.loman at bham.ac.uk
Fri Nov 28 11:12:32 UTC 2008


Peter wrote:

>>> Yes, SQLAlchemy seems pretty good.  The only catch was for a table
>>> with no primary key defined at all (the taxon_name table) which
>>> required a little more work setting up the ORM mapping, but which also
>>> seems to work fine.
>> It has one unique key defined on (name, name_class, taxon_id). Is that not
>> what you are seeing?
>>
>>        -hilmar
> 
> According to the MySQL schema, taxon_name has a unique restraint but
> does NOT have a primary key:

Just to say I've had good results using the Django 
(http://www.djangoproject.com) ORM system with a BioSQL database.

You can get going quite quickly using the Django introspection feature 
(configure your settings.py file and run python manage.py inspectdb to 
get a models file).

However, the version of Django I use (not sure about latest) didn't 
support multi-column indexes as primary key, so I had to add another 
auto_increment column to use as a primary key.

Cheers,

Nick.





More information about the BioSQL-l mailing list