Re: [sqlalchemy] textcolumn.contains() escaping, the lack of icontains(), and possible bug?

2013-10-04 Thread Bobby Impollonia
Converting strings to lower case and comparing them is not the same as a true case-insensitive comparison. Python 3.3 adds a str.casefold method for this reason. The docs for that method give a good explanation of the distinction: """Casefolding is similar to lowercasing but more aggressive beca

Re: [sqlalchemy] Relationship configuration that isn't functioning as I expect

2013-05-16 Thread Bobby Impollonia
affiliation I fetch after the flush incorrectly tells me that its street_address is None. However, I don't see this being a problem in production and I think this will work for our application. Thanks. On Thursday, May 16, 2013 12:49:17 PM UTC-7, Michael Bayer wrote: > > > On

Re: [sqlalchemy] textcolumn.contains() escaping, the lack of icontains(), and possible bug?

2013-05-16 Thread Bobby Impollonia
Sounds like a useful feature. Regarding case sensitivity, perhaps it would better if each of these methods (even like() and contains()) took a keyword argument along the lines of col.endswith('foo', case_sensitive=False) rather than adding extra methods with weird names like iendswith. On Mond

[sqlalchemy] Re: SQLServer + Datetimes returning odd results?

2013-05-16 Thread Bobby Impollonia
I think this value is coming from the underlying database driver rather than SQLAlchemy. If you execute the stored proc directly using the driver (I guess this is pymssql), do you see the same behavior? On Thursday, May 16, 2013 12:37:56 PM UTC-7, John Anderson wrote: > > I have a SQLServer DB

[sqlalchemy] Relationship configuration that isn't functioning as I expect

2013-05-16 Thread Bobby Impollonia
I am trying to create a relationship to work with a legacy schema and am having trouble configuring it to behave as I want. As a disclaimer, I understand why the schema here is not the schema one would use if starting from scratch. Anyway, I have simplied the situation down to the following exa

Re: [sqlalchemy] contains_eager and ordering

2013-05-07 Thread Bobby Impollonia
the Python side is orderinglist: > http://docs.sqlalchemy.org/en/rel_0_8/orm/extensions/orderinglist.htmland it > works pretty well when you aren't dealing with the primary key. > > > > > > On May 7, 2013, at 1:03 AM, Bobby Impollonia > > wrote: > > I am execut

[sqlalchemy] contains_eager and ordering

2013-05-06 Thread Bobby Impollonia
I am executing a query with contains_eager to load objects and their related objects from a different table. I would like to control the order of the related objects within each InstrumentedList. I had hoped this could be done through the ordering in the query. For example, with a query like: s

Re: [sqlalchemy] Backref confusion

2012-11-13 Thread Bobby Impollonia
Thank you! That is exactly the function I needed. On Tuesday, November 13, 2012 9:16:47 PM UTC-8, Michael Bayer wrote: > > > On Nov 13, 2012, at 11:03 PM, Bobby Impollonia wrote: > > I have constructed a sample program consisting of two mapped classes > (using sqlalchemy.ext

[sqlalchemy] Re: setattr + unmapped attribute

2012-11-13 Thread Bobby Impollonia
The behavior here isn't SQLAlchemy-specific. If you change: class MyClass(Base): __tablename__ = 'some_table' id = Column(Integer, primary_key=True) to class MyClass(object): pass , you will see the same behavior. On Tuesday, November 13, 2012 5:05:24 PM UTC-8, MikeParent wrote: >

[sqlalchemy] Backref confusion

2012-11-13 Thread Bobby Impollonia
I have constructed a sample program consisting of two mapped classes (using sqlalchemy.ext.declarative) that have a relationship/ backref between them. At runtime the program does the following: 1) Print whether the parent class has an attribute for its relationship to the child (declared as the

[sqlalchemy] ObjectDeletedError when query.delete() hits an expired item

2011-04-07 Thread Bobby Impollonia
Hi. With SQLA 0.6.6, the program below fails on the last line with ObjectDeletedError. Is this expected or a bug? from sqlalchemy import create_engine, MetaData, Column, Unicode from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base engine = create_engine(

[sqlalchemy] Warning: Incorrect datetime value

2010-02-10 Thread Bobby Impollonia
I am constructing queries involving MSTimeStamp fields in MySQL and am being receiving "Incorrect datetime value" warnings even in situations where my queries are valid in MySQL. How do I modify the following query so that sqlalchemy will accept it without warning: session.query(MyClass.id).filter

[sqlalchemy] Warning: Incorrect datetime value

2010-02-10 Thread Bobby Impollonia
I am constructing queries involving MSTimeStamp fields in MySQL and am being receiving "Incorrect datetime value" warnings even in situations where my queries are valid in MySQL. How do I modify the following query so that sqlalchemy will accept it without warning: session.query(MyClass.id).filter

[sqlalchemy] Re: Multi table select?

2009-10-26 Thread Bobby Impollonia
You can also create a view mapped to that union and use that as a virtual table so that you don't have to repeat the union specification for every query: http://www.w3schools.com/Sql/sql_view.asp I don't know if that helps for SQLAlchemy though. On Mon, Oct 26, 2009 at 5:59 PM, AF wrote: > > >

[sqlalchemy] Re: aggregation with count and webhelpers.paginate

2009-06-22 Thread Bobby Impollonia
You could also use a label to avoid the repetition: from sqlalchemy.sql import desc meta.Session.query(m.Hit.referer, func.count(m.Hit.id).label('count'))\ .group_by(m.Hit.referer)\ .order_by(desc('count')) On Mon, Jun 22, 2009 at 2:22 AM, King Simon-NFHD78 wrote: > >> -Or

[sqlalchemy] Re: Random value for field by default?

2009-06-21 Thread Bobby Impollonia
Yes, it is safe. Python's underlying random number generation is threadsafe. There is no need to create a new RNG each time to generate a single number. On Sun, Jun 21, 2009 at 1:53 PM, allen.fowler wrote: > > >> default = lambda: random.randrange(1000,1) >> > > Seems we crossed in the interw

[sqlalchemy] Re: Random value for field by default?

2009-06-21 Thread Bobby Impollonia
default = lambda: random.randrange(1000,1) On Sun, Jun 21, 2009 at 1:32 PM, AF wrote: > > Hello, > > Perhaps this is more of a Python question that SQLalchemy.. but... > > > How can I assign a random number to a DB field by default? > > > I tried: > default = random.randrange(1000,1)

[sqlalchemy] Re: Relation Bug in SA?

2009-06-12 Thread Bobby Impollonia
The error is complaining about the backref ("on relation Royalty.owner"), so it makes sense that it would go away if you remove the backref. The error says that you need to specify foreign_keys for the backref, so you should try that. i.e, change backref='owner' to backref=backref('owner', fore

[sqlalchemy] Re: Small note on reading SA docs

2009-05-21 Thread Bobby Impollonia
an tell them not to use certain pages as sitelinks via the google webmaster tools. They'll remove them, but they don't get replaced so you will have two fewer sitelinks then. On Thu, May 21, 2009 at 8:03 PM, Bobby Impollonia wrote: >>  otherwise if you have any advice on how to get 0

[sqlalchemy] Re: Small note on reading SA docs

2009-05-21 Thread Bobby Impollonia
>  otherwise if you have any advice on how to get 0.4/0.3 > delisted from such a prominent place on Google, that would be > appreciated. The simplest thing to do is to append: Disallow: /docs/04/ Disallow: /docs/03/ to the file: http://www.sqlalchemy.org/robots.txt This tells google (and all we

[sqlalchemy] Re: When to create new sessions?

2009-04-08 Thread Bobby Impollonia
Now the decorator swallows exceptions silently. You have to reraise the exception after rolling back like Michael did. I believe the correct form is: def transaction(f): def wrapper(*args, **kwargs): try: value = f(*args, **kwargs) except: session.rollb

[sqlalchemy] Re: relation that works in .48 but fails in .53

2009-04-08 Thread Bobby Impollonia
rue) > > >  class Other(Base): >     __tablename__ = 'other' >     id = Column(Integer, primary_key=True) >     child1_id = Column(Integer, ForeignKey('child1.id')) >     child1_object = relation('Child1', backref='others', primaryjoin = >  

[sqlalchemy] relation that works in .48 but fails in .53

2009-04-08 Thread Bobby Impollonia
I am porting some code from SQLA .48 to .53 . I have a relation that works in .48, but not in .53. At the end of this post is a test program demonstrating the problem. The program works in .48 but fails in .53 trying to understand the child1_object relation . The error message says to add foreign

[sqlalchemy] Re: SQLAlchemy syntax for part of a datetime value in order_by.

2009-03-10 Thread Bobby Impollonia
from sqlalchemy.sql import func query = model.MyClass.query.order_by(func.date(model.MyClass.created_at)) This applies the sql "date" function to the column. That function definitely exists in mysql; I'm not sure if it is standard, but if not I'm sure you can find an equivalent function for whate

[sqlalchemy] Re: Self Join via Join Table ?

2009-02-25 Thread Bobby Impollonia
I am doing something similar. The following code works for me in SQLA .4.8 class Foo(Base): __tablename__ = 'foo' id = Column(Integer, primary_key=True) bar_table = Table('bar', Base.metadata, Column('parent_id', Integer, ForeignKey('foo.id'), nullable=False), Column('child_id', I

[sqlalchemy] Re: Simple performance comparison between SQLAlchemy and SQLObject

2009-02-19 Thread Bobby Impollonia
It is not efficient at all to individually flush each of 20,000 new rows to the database (the flush() happens implicitly via autoflush when you query for the row) and read them back one by one. I would change the primary key fields to auto increment in mysql so you don't have to set them yourself

[sqlalchemy] Re: Best way to count( some_relation )

2009-01-26 Thread Bobby Impollonia
I think you have to use group by with a count(). Something like Account.query.join(Account.users).group_by(Account.id).filter(func.count(User.id) > 1) On Mon, Jan 26, 2009 at 12:59 PM, Jon Nelson wrote: > > Let's assume I have a 1:many relationship between Accounts and Users. > > What I want (f

[sqlalchemy] Re: ORM base class for 0.5?

2009-01-15 Thread Bobby Impollonia
The declarative extension (sqlalchemy.ext.declarative) provides a __init__ that takes keyword args for attributes (at least it does in 0.4). On Tue, Jan 13, 2009 at 4:02 AM, Christoph Haas wrote: > Thanks for the code. For those who might also be interested in an ORM base > class providing __ini

[sqlalchemy] Re: retrying queries and 'Lost connection to MySQL server'

2008-12-21 Thread Bobby Impollonia
he worker calls dispose() before or during the sql stuff going on in the parent, but that shouldn't mater, right? Is it possible that the call to dispose() is somehow closing the connection in a way that sabotages the parent? On Sun, Dec 21, 2008 at 11:32 PM, Michael Bayer wrote: > > > On

[sqlalchemy] retrying queries and 'Lost connection to MySQL server'

2008-12-21 Thread Bobby Impollonia
I occasionally have a query fail with 'Lost connection to MySQL server during query' which gets converted into a sqlalchemy.exceptions.OperationalError. I have not been able to figure out why it happens, but the server should always be available. I would like to tell sqlalchemy that if a query fa

[sqlalchemy] Re: ORM Query that selects only a subset of the columns

2008-11-19 Thread Bobby Impollonia
e. On Wed, Nov 19, 2008 at 1:25 PM, Moshe C. <[EMAIL PROTECTED]> wrote: > > 0.4.6 > > On Nov 19, 11:12 pm, "Bobby Impollonia" <[EMAIL PROTECTED]> wrote: >> What version of SQLA are you using? In .5 , you can pass individual >> columns instead of a mapped

[sqlalchemy] Re: ORM Query that selects only a subset of the columns

2008-11-19 Thread Bobby Impollonia
What version of SQLA are you using? In .5 , you can pass individual columns instead of a mapped class to session.query. On Wed, Nov 19, 2008 at 12:17 PM, Moshe C. <[EMAIL PROTECTED]> wrote: > > For Query there is an add_column() method, but I do not see a remove > column method. > Initializing a

[sqlalchemy] Re: ORM: Retrieving table from mapped class

2008-11-16 Thread Bobby Impollonia
Are you using declarative? If so, your class will have a property called __table__ On Sun, Nov 16, 2008 at 4:04 PM, Moshe C. <[EMAIL PROTECTED]> wrote: > > Hi, > Given a mapped ORM class, is it possible to retrieve from it the Table > instabce to which it was mapped? > TIA > Moshe > > > > --~--~

[sqlalchemy] Re: select where field=max(field)

2008-11-07 Thread Bobby Impollonia
If you are okay with only getting one record in the case of ties you can do session.query(Snapshot).order_by(Snapshot.totalqty.desc()).first() On Fri, Nov 7, 2008 at 12:22 PM, John Hunter <[EMAIL PROTECTED]> wrote: > > I am having trouble writing a sqlalchemy query which selects all rows > where

[sqlalchemy] Re: Forks() and Alchemy

2008-09-19 Thread Bobby Impollonia
If you have a session and then you fork, the child process is going to try to use the same session but that won't work because connections can't be floated across processes. If you call dispose() on the engine in the child process after forking (e.g., metadata.bind.dispose() ), then the child will

[sqlalchemy] Re: NOT IN in orm queries

2008-09-02 Thread Bobby Impollonia
from sqlalchemy import not_ session.query(Region).filter(not_(Region.id.in_( (1,2,3) ))) alternately, session.query(Region).filter(~ Region.id.in_( (1,2,3) )) On Tue, Sep 2, 2008 at 6:59 AM, Artur Siekielski <[EMAIL PROTECTED]> wrote: > > Hi. > How can I use "...WHERE sth NOT IN (1, 4 ,5)" quer

[sqlalchemy] Re: Run basic query

2008-07-22 Thread Bobby Impollonia
The sqlalchemy update statement is documented here: http://www.sqlalchemy.org/docs/05/sqlexpression.html#sql_update Basically, you want something like conn.execute(foo.update(values={foo.c.bar: 0 })) On Tue, Jul 22, 2008 at 10:49 AM, Heston James - Cold Beans <[EMAIL PROTECTED]> wrote: > Guys,

[sqlalchemy] Re: Boolean, Declerative, MySQL 5.2

2008-07-20 Thread Bobby Impollonia
I am using Column(Boolean) with declarative and MySQL and it is working fine. In MySQL itself the type is 'tinyint(1)' but they provide 'bool' and 'boolean' as synonyms if you prefer. On Sat, Jul 19, 2008 at 7:48 AM, Heston James - Cold Beans <[EMAIL PROTECTED]> wrote: > Hello Guys, > > > > I'm l

[sqlalchemy] Re: result as the dict()

2008-07-07 Thread Bobby Impollonia
>MyBase = type("MyBase", (Base, MyMixin), {}) Is this any different than just doing class MyBase(Base, MyMixin): pass ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this gro

[sqlalchemy] Re: Multiple encodings in my database

2008-06-27 Thread Bobby Impollonia
If I am using the mysql-specific Column constructs with the charset option, will things be automatically encoded/ decoded by SA using that charset? Or is the charset option only used for Create Table? On Thu, Jun 26, 2008 at 7:20 PM, Michael Bayer <[EMAIL PROTECTED]> wrote: > > first of all, the

[sqlalchemy] Re: Searching in all fields

2008-06-27 Thread Bobby Impollonia
If you do them as double percent signs ( '%%') then the python string formatting will replace them with single percent signs. On Fri, Jun 27, 2008 at 9:12 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi. > > I want to do robust algorithm for searching in tables...the simplest > example is

[sqlalchemy] Re: how to do manualy incremented counter

2008-06-24 Thread Bobby Impollonia
In mysql you can declare a integer column to be auto_increment and it will handle for you giving each row a different number. Other databases have similar mechanisms. It sounds like the invoice number is the primary key for the invoice table? If you have a integer primary key in sqlalchemy, it ass

[sqlalchemy] Is it possible to have a relation on string?

2008-06-11 Thread Bobby Impollonia
Does SA support the following scenario? : I have a class (let's call in User). I have a many-to-many relationship between Users and urls where a url is just a string. So I want to have a secondary table where one column is a foreign key on User and the other is a string. If the second column wher

[sqlalchemy] Re: Create polymorphic mapped instance from type discriminator

2008-06-06 Thread Bobby Impollonia
The mapper for the base class has a property called polymorphic_map which is a dictionary whose keys are the discriminator values and whose values are the mappers of the associated classes (you can get from there to the actual class via the mapper's class_ property). I can't speak to whether this

[sqlalchemy] Re: ordering

2008-05-30 Thread Bobby Impollonia
You can add .order_by(None) to the query to remove the default ordering. On Fri, May 30, 2008 at 12:25 PM, Geoff <[EMAIL PROTECTED]> wrote: > > Hi! > > I've noticed that a very simple query has an ordering applied to it > even though I haven't asked for one. Is there a way to stop it doing > that

[sqlalchemy] Re: Using multiple filter()s with contains() in a query

2008-05-21 Thread Bobby Impollonia
ny > coverage for this exact scenario and there wasn't any "aliasing" logic > removed AFAIK. > > > On May 21, 2008, at 12:07 PM, Bobby Impollonia wrote: > >> >> Hi. If I have a many-to-many relation between Class1 and Class2, the >> following query:

[sqlalchemy] Using multiple filter()s with contains() in a query

2008-05-21 Thread Bobby Impollonia
Hi. If I have a many-to-many relation between Class1 and Class2, the following query: Class1.query.filter(Class1.class2s.contains(obj1)).filter(Class1.class2s.contains(obj2)) , where obj1 and obj2 are instances of Class2, generates the following sql in .4.6: SELECT FROM class1, secondary WHERE c

[sqlalchemy] Re: SQLAlchemy 0.4.6 released

2008-05-15 Thread Bobby Impollonia
Any idea when a .deb will be available? http://packages.debian.org/unstable/python/python-sqlalchemy is still .4.5 On Wed, May 14, 2008 at 3:02 PM, Michael Bayer <[EMAIL PROTECTED]> wrote: > > SQLAlchemy 0.4.6 is now available at: > > http://www.sqlalchemy.org/download.html > > This release inclu

[sqlalchemy] Re: trunk is now on 0.5

2008-05-12 Thread Bobby Impollonia
I dont see how this: cls.query.left_bracket().filter_or(cls.y == 17).filter_or(cls.x==27).right_bracket() is clearer than this: cls.query.filter(or_(cls.y == 17, cls.x==27)) Also, another vote for cutting off python 2.3. Seriously, it's 2008. On Mon, May 12, 2008 at 11:58 AM, <[EMAIL PROTECTED]

[sqlalchemy] Re: The IN Construct

2008-05-09 Thread Bobby Impollonia
in_ is a method that exists on a column. You pass it the list of things that the column value should be in. For example, if you have a class called MyClass that is mapped to a table and has a column called id, you can do: session.query(MyClass).filter(MyClass.id.in_( [ 3, 4] )).all() On Fri, Ma

[sqlalchemy] Re: relation that only fails with a backref

2008-05-08 Thread Bobby Impollonia
Another issue with this relation is that it doesn't like being eagerloaded. Using the same model from my first post (with the broken backref removed or fixed): session.query(Child1).options(eagerload('left_child2')).first() Generates the sql: SELECT anon_1.child1_id AS anon_1_child1_id, anon_1.pa

[sqlalchemy] Re: Multiple SQLAlchemy DB usage in TurboGears

2008-05-08 Thread Bobby Impollonia
> I'd try bypassing their SQLA integration altogether if thats possible It isn't possible if you are relying on the turbogears identity system (cookie-based visitor tracking and access control). --~--~-~--~~~---~--~~ You received this message because you are subsc

[sqlalchemy] Re: relation that only fails with a backref

2008-05-08 Thread Bobby Impollonia
ise if multiple rows were returned. On Wed, May 7, 2008 at 8:22 PM, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > > On May 7, 2008, at 7:23 PM, Bobby Impollonia wrote: > > > > > secondary_table = Table('secondary', Base.metadata, > >Column(

[sqlalchemy] relation that only fails with a backref

2008-05-07 Thread Bobby Impollonia
secondary_table = Table('secondary', Base.metadata, Column('left_id', Integer, ForeignKey('parent.id'), nullable=False), Column('right_id', Integer, ForeignKey('parent.id'), nullable=False)) class Parent(Base): __tablename__ = 'parent' id = Column(Integer, primary_key=True) cl

[sqlalchemy] Re: Duplication of rows in many-to-many relationship

2008-05-04 Thread Bobby Impollonia
I thought that defining relation with a backref was just a convenient shorthand for defining two relations. This makes it sound like are practical differences between the two techniques. Is this true? What are the differences? Also, does having the unique key that you recommend stop SA from tryin

[sqlalchemy] possible bug with join inheritance and contains()

2008-05-02 Thread Bobby Impollonia
I have a class that I will call Child which inherits via join inheritance from a class I will call Parent. There is a many-to-many relationship between Child and a class that I will call Other. A query that looks like this: child = Other.query.filter(not_(other.child_objects.contains(child))).fi

[sqlalchemy] Re: join inheritance and mutual foreign keys behind tables

2008-05-02 Thread Bobby Impollonia
Awesome. For now, the inherit_condition mapper arg is working fine, so thanks for that. On Thu, May 1, 2008 at 9:03 PM, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > On May 1, 2008, at 6:25 PM, Bobby Impollonia wrote: > > > > > > It no longer works. In partic

[sqlalchemy] join inheritance and mutual foreign keys behind tables

2008-05-01 Thread Bobby Impollonia
Hi. I have two tables that have foreign keys on each other. The following works fine, where Base is a declarative base: class Child1(Base): __tablename__ = 'child1' id = Column('id', Integer, primary_key=True) related_child2 = Column('c2', Integer, ForeignKey('child2.id', use_alter = T

[sqlalchemy] Re: Creating multiple tables based on the same class

2008-04-07 Thread Bobby Impollonia
Yes, you can have the same class be associated with different tables at different times. Sqlalchemy uses a 'maper' to associate a class with a table. You can define multiple mappers for the same class that map it to different tables. One of these will be the primary mapper and will be used by def

[sqlalchemy] Re: Insert Expressions - Executing Multiple Statements

2008-04-07 Thread Bobby Impollonia
You could specify that fullname is null (None) for the columns that don't have a full name value. On Mon, Apr 7, 2008 at 8:04 AM, Carla <[EMAIL PROTECTED]> wrote: > > Hello all > > I'd like to insert more than one expression in a table. Some > expressions don't have an entry in every column: >

[sqlalchemy] Re: what = declarative_base

2008-04-02 Thread Bobby Impollonia
I like having the base of my models be .model.Base . That name does a good job of describing what role the class plays; it is the common base on which each model is built. If I were mixing declarative and non-declarative models, then I could understand wanting the declarative ones to be distingui

[sqlalchemy] aliases and joins

2008-04-02 Thread Bobby Impollonia
Hi. I have a simple model that looks like this: Base = declarative_base(metadata=metadata) class Item(Base): __tablename__ = 'item' id = Column('id', Integer, primary_key=True) group = Column('group', Integer) Groups have no useful information other than the items they contain, so I

[sqlalchemy] Re: Circular table dependencies and ext.declarative

2008-04-01 Thread Bobby Impollonia
f the keys is the one to have use_alter)? On Tue, Apr 1, 2008 at 6:54 PM, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > On Apr 1, 2008, at 5:59 PM, Bobby Impollonia wrote: > > > > > This fails (as expected) because of the circular dependency. Before I > > swit

[sqlalchemy] Circular table dependencies and ext.declarative

2008-04-01 Thread Bobby Impollonia
Hi. I am using sqlalchemy with a database that has two tables that each have foreign keys on the other. The situation this is modeling is a tree where the levels alternate between two different types of node. Each Node1 has a parent of type Node2 (or null for the root) and each Node2 has a parent

[sqlalchemy] Re: can I set the really default value ?

2008-03-30 Thread Bobby Impollonia
That will set the default in python, not in sql. If it really needs to be in the create table statements, use PassiveDefault: http://www.sqlalchemy.org/docs/04/metadata.html#metadata_defaults_passive On Sun, Mar 30, 2008 at 2:30 PM, Andreas Jung <[EMAIL PROTECTED]> wrote: > > > --On 31. März 2008

[sqlalchemy] Re: using a model inherits from dict

2008-03-29 Thread Bobby Impollonia
If the only dict behavior you need is accessing elements with [], another approach is that you could implement __getitem__ in your model but not inherit from dict. On Sat, Mar 29, 2008 at 3:08 PM, Mike Bernson <[EMAIL PROTECTED]> wrote: > > I am trying to use models that inherit from dict. > >

[sqlalchemy] Re: sqlalchemy.ext.declarative and scoped session

2008-03-29 Thread Bobby Impollonia
t; On Mar 29, 2008, at 9:13 AM, Bobby Impollonia wrote: > > > > > > > Hi. I recently switched a sqlalchemy project from using manual mapping > > of classes to ext.declarative. > > > This is in a turbogears project and I am using their metadata and > > ma

[sqlalchemy] sqlalchemy.ext.declarative and scoped session

2008-03-29 Thread Bobby Impollonia
Hi. I recently switched a sqlalchemy project from using manual mapping of classes to ext.declarative. This is in a turbogears project and I am using their metadata and mapper. Before I had: from turbogears.database import metadata, mapper users_table = sqlalchemy.Table('users', metadata, ... ) c