[sqlalchemy] Re: how to remove table from an engine

2006-11-05 Thread robert rottermann
Michael Bayer wrote: create a new, empty MetaData instance. redefine=True didnt work so great since tables have dependencies on each other. thanks for the answer, I just saw that redefine is still in the docstring for 0.3s Table class. robert

[sqlalchemy] Re: Microsoft Jet Database Engine

2006-11-05 Thread Jorge Vargas
On 11/4/06, Rick Morrison [EMAIL PROTECTED] wrote: Wow, Jet? There's a blast from the past. I would be amazed if you could get 100% of the unit tests to pass, as some of Jet's SQL syntax can vary quite a bit from ANSI standards. Did you use an ODBC connector, DAO or ADO? A general-purpose

[sqlalchemy] Re: Thread issue?

2006-11-05 Thread Michael Bayer
OK, i had the impression you were switching the mapper inside of a relation() somehow, but it seems all youre doing is sticking a mapper on a property (i dont quite understand how youd use it ? ) if i understand properly, id just do it this way: class dbPeople(object): def fixRace(self,

[sqlalchemy] Re: Thread issue?

2006-11-05 Thread François Wautier
Thanks for your reply, OK, i had the impression you were switching the mapper inside of a relation() somehow, but it seems all youre doing is sticking a mapper on a property (i dont quite understand how youd use it ? ) I want to use it like this fixRace(dbPeople, myrace)

[sqlalchemy] Inheritance and relation in primary table

2006-11-05 Thread laurent rahuel
Hi, I'm still experimenting SA features and, once again, I'm stucked with a relation definition problem. This is the deal. Considering this tables definition : USERS = Table('users', metadata, Column('id', Integer, primary_key=True), Column('name', String(255), nullable=False), )

[sqlalchemy] Re: Inheritance and relation in primary table

2006-11-05 Thread Michael Bayer
it all looks fine to me, youd have to show me something more specific. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To

[sqlalchemy] Re: Inheritance and relation in primary table

2006-11-05 Thread laurent rahuel
Here is an attached sample of my problem. You can create a User, u, and a Folder, f. Assign ownership via a simple f.owner = u. You can do an : objectstore.save(u) objectstore.save(f) You can see relations via print f.owner print u.objects But this can not be saved into the database. An

[sqlalchemy] how to select a database with MySQL

2006-11-05 Thread robert rottermann
hi there, i want to create a database in mysql and then use it. this is what I do: in the __init__ def __init__( self, connectionstr ): self.connectionstr = connectionstr def _checkEngine(self): if self._db_engine is None: self._db_engine =

[sqlalchemy] Re: polymorphic_identity determination

2006-11-05 Thread Randall Smith
I've attached a file which is a variant to the employees example with two objectives. 1. Base polymorphic_identity on select criteria (no type column). 2. Use two levels of inheritance. The first objective seems to be met, but the second is not working properly. I put in two Managers, two

[sqlalchemy] Re: Inheritance and relation in primary table

2006-11-05 Thread Michael Bayer
sqlite's autoincrement feature does not work when you define a composite primary key. youll have to set the id attribute on each instance manually before flushing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: polymorphic_identity determination

2006-11-05 Thread Michael Bayer
if you change your echo to 'debug', or just select straight from your p_union selectable, youll see these rows: (5, u'cengineer1', u'cengineer1', u'cengineer1', None, u'chemical_engineer') (6, u'cengineer2', u'cengineer2', u'cengineer2', None, u'chemical_engineer') (1, u'manager1', None, None,

[sqlalchemy] Re: Inheritance and relation in primary table

2006-11-05 Thread laurent rahuel
Tried with a postgresql database and I get another error right in my metadata.create_all(). I get a SQLError: (ProgrammingError) from postgres telling me I got something wrong while creating constraint on unexisting key into table bases. CREATE TABLE folders ( id INTEGER NOT NULL,

[sqlalchemy] Disregard the last message please

2006-11-05 Thread claudio . s . martinez
I cannot reply to it because I'm having a 8 hour lag on my posts in Google groups (no idea why) I was having problems getting the defaults to the database structure, after checking get_column_default_string from the ANSI schema creator I realized that it was wrong to skip the PassiveDefault

[sqlalchemy] arbitary sql queries (or how to select a bool from postgres)

2006-11-05 Thread sb
Hello, I'm using sqlalchemy.mod.threadlocal with object mappers and sessions, works greate sofar;). Now, for the first time, I have the desire to do something completely different. Select a bool from the database, like SELECT %s in (SELECT ); % some_id What is the most straight forward

[sqlalchemy] indexu-style category tree of arbitrary depth

2006-11-05 Thread jeffk
I need to implement an indexu-style category tree of arbitrary depth: News Media (64) Arts and Humanities, Automotive, Business Recreation Sports (234) Amusement and Theme Parks, Automotive, Aviation Reference (32) Acronyms and Abbreviations, Almanacs, Arts and Humanities

[sqlalchemy] Column __repr__ with sqlalchemy types instead of db-specific object instances?

2006-11-05 Thread jeffk
I have a versioned repository of SQL DDL that I'd like to convert to versioned sqlalchemy models, using the Table(...,autoload=True) feature. I suspect it may be a lossy operation to do so, but in the interest of table documentation, is there a way to render the Table.__repr__() with for example

[sqlalchemy] Re: Column __repr__ with sqlalchemy types instead of db-specific object instances?

2006-11-05 Thread Michael Bayer
__repr__() really annoys me because no matter what i do with it, people tell me im using it incorrectly. technically, __repr__() is supposed to return a string that when eval'ed would return the object instance. which is not realistic for an object like Table since its an enormous construction.

[sqlalchemy] Re: polymorphic_identity determination

2006-11-05 Thread John M Camara
Randall Smith wrote: For discussion, consider the Employee, Manager, Engineer example from the docs. If I were designing the tables, I would not normally have a type field. I would use the null status of engineer_info or manager_data to determine the employee type. Or if that data was in

[sqlalchemy] Re: polymorphic_identity determination

2006-11-05 Thread Randall Smith
John, Thanks for the feedback. The code I put up is not part of any real system. I'm just playing off of the existing examples in the docs and trying to get comfortable with SA inheritance. Randall John M Camara wrote: Randall Smith wrote: For discussion, consider the Employee,