[sqlalchemy] Orphaned parents..

2007-05-04 Thread Arnar Birgisson
Hi all, Say I have this simple model: DayTimesheet date: a Date entries: a list of TimeEntry TimeEntry: day: a DayTimesheet in: a time (HH:MM) out: a time (HH:MM) DayTimesheet is the parent of TimeEntry in a one-to-many relationship. What would be the best way of ensuring the

[sqlalchemy] Re: multiple M:N joins fails

2007-05-04 Thread ml
Michael Bayer napsal(a): On May 1, 2007, at 4:42 AM, ml wrote: I want to get recipes which belongs to a particular category and having a particular flag. So I need both joins recipe-category and recipe- flag. ah. in that case you dont want query.join(x).join(y), you want the

[sqlalchemy] Re: 'MapperExtension' object has no attribute 'translate_row'

2007-05-04 Thread Sanjay
testcase please Here is the sample code which works perfectly till 0.3.4 and produces error in newer versions in my system: from sqlalchemy import * from sqlalchemy.ext.assignmapper import assign_mapper from sqlalchemy.ext.sessioncontext import SessionContext context =

[sqlalchemy] Re: multiple M:N joins fails

2007-05-04 Thread Michael Bayer
On May 4, 2007, at 9:23 AM, ml wrote: Michael Bayer napsal(a): On May 1, 2007, at 4:42 AM, ml wrote: I want to get recipes which belongs to a particular category and having a particular flag. So I need both joins recipe-category and recipe- flag. ah. in that case you dont want

[sqlalchemy] Re: 'MapperExtension' object has no attribute 'translate_row'

2007-05-04 Thread King Simon-NFHD78
Hi, Your TaskExtension class doesn't have a translate_row method, which apparently is part of the MapperExtension interface (although it doesn't appear in the docs). From the source code (in orm/mapper.py): def translate_row(self, mapper, context, row): Perform pre-processing on the

[sqlalchemy] Re: Could not assemble any primary key columns for mapped table

2007-05-04 Thread Michael Bayer
On May 4, 2007, at 9:17 AM, ml wrote: Hi! I have a few tables with non-integer primary keys. Following raises an exception: meta = MetaData(name=somemeta) themes = table(themes, meta, Column(title, Unicode(30), primary_key=True), ) class Theme(object): pass mapper(Theme,

[sqlalchemy] Re: sqlalchemy introspection How?

2007-05-04 Thread Michael Bayer
On May 4, 2007, at 4:08 PM, johnny wrote: theres another extension called SqlSoup that does what I think youre asking for. creates the classes on the fly for each table which it also reflects on the fly. http://www.sqlalchemy.org/trac/wiki/SqlSoup This is what I need. I have one more

[sqlalchemy] Re: Orphaned parents..

2007-05-04 Thread Jorge Godoy
Arnar Birgisson [EMAIL PROTECTED] writes: Hi all, Say I have this simple model: DayTimesheet date: a Date entries: a list of TimeEntry TimeEntry: day: a DayTimesheet in: a time (HH:MM) out: a time (HH:MM) DayTimesheet is the parent of TimeEntry in a one-to-many

[sqlalchemy] Bit of A Memory Problem with Python/SA

2007-05-04 Thread jvburnes
Hi there! I'm having a little trouble figuring out why my parsing / database application is consuming vast amounts of memory. I'll preface this by saying that perhaps SA isn't the best solution for my problem. The app basically parses through hundreds of megabytes of text files looking for

[sqlalchemy] Re: 'MapperExtension' object has no attribute 'translate_row'

2007-05-04 Thread Sanjay
Your TaskExtension class doesn't have a translate_row method, which apparently is part of the MapperExtension interface (although it doesn't appear in the docs). From the source code (in orm/mapper.py): def translate_row(self, mapper, context, row): Perform pre-processing on the