[sqlalchemy] Re: Mixing a column declared with @declared_attr into a child class is not mapped in parent class when using STI

2012-04-19 Thread Amos
It would be great for declarative to resolve a conflict (perhaps with a warning) if the column definitions are exactly the same - though I can see this getting complicated with nested ForeignKey objects, etc. That said, I really like the idea of exposing the conflict resolution mechanism to the use

Re: [sqlalchemy] stucco_evolution 0.4 released

2012-04-19 Thread Michael Bayer
On Apr 19, 2012, at 3:20 PM, Daniel Holth wrote: > > > So there you have it. It very well may be that there is exactly one use > > case for this package, but who doesn't need to keep track of users and > > groups? Other than that it does a passable job of applying hand-written > > linear data

Re: [sqlalchemy] stucco_evolution 0.4 released

2012-04-19 Thread Daniel Holth
> > So there you have it. It very well may be that there is exactly one use > case for this package, but who doesn't need to keep track of users and > groups? Other than that it does a passable job of applying hand-written > linear database upgrades, and it is short. > > that it is, and the su

Re: [sqlalchemy] stucco_evolution 0.4 released

2012-04-19 Thread Michael Bayer
On Apr 19, 2012, at 2:23 PM, Daniel Holth wrote: > > So there you have it. It very well may be that there is exactly one use case > for this package, but who doesn't need to keep track of users and groups? > Other than that it does a passable job of applying hand-written linear > database upg

Re: [sqlalchemy] stucco_evolution 0.4 released

2012-04-19 Thread Daniel Holth
On Thursday, April 19, 2012 1:43:59 PM UTC-4, Michael Bayer wrote: > > If you've seen my recent talks you saw that I'm a little skeptical of what > you're terming "non-monolithic" databases.Let's say this means, a > database with a set of tables maintained by entirely different packages, > b

Re: [sqlalchemy] stucco_evolution 0.4 released

2012-04-19 Thread Michael Bayer
If you've seen my recent talks you saw that I'm a little skeptical of what you're terming "non-monolithic" databases.Let's say this means, a database with a set of tables maintained by entirely different packages, but with the possibility of dependencies between those tables.If I underst

Re: [sqlalchemy] Problem with column_mapped_collection and joined table inheritance

2012-04-19 Thread Debilski
Thanks for adding it. I’ll promise to include a test case next time. Cheers /rike -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/f18Gk7IZM1YJ. To post to this

Re: [sqlalchemy] Problem with column_mapped_collection and joined table inheritance

2012-04-19 Thread Michael Bayer
Hi - thanks, I've reopened ticket 2409. Please send along more detail next time as I had to do quite a bit of guessing as to how to reproduce a bug here, thanks ! On Apr 19, 2012, at 10:04 AM, Debilski wrote: > Hi, > > it seems there has been a bug introduced in > http://hg.sqlalchemy.

Re: [sqlalchemy] how to set the initial value for auto_increment?

2012-04-19 Thread Michael Bayer
SQLite doesn't support an initial value for auto-incrementing fields. It has two flavors of autoincrement, the ROWID and AUTOINCREMENT versions. By setting sqlite_autoincrement it means you're choosing AUTOINCREMENT. But neither support a way to set the initial value, see http://sqlite.

Re: [sqlalchemy] automating inheritance

2012-04-19 Thread Michael Bayer
On Apr 19, 2012, at 6:23 AM, lars van gemerden wrote: > I am trying to my my joined inheritance code clearer, for the dynamic > generation of sa classes and tried to do something like this: > > > class InheritMixin(object): > >@declared_attr >def __tablename__(cls): >return cls

[sqlalchemy] Problem with column_mapped_collection and joined table inheritance

2012-04-19 Thread Debilski
Hi, it seems there has been a bug introduced in http://hg.sqlalchemy.org/sqlalchemy/rev/4e9c059abca3 when using both column_mapped_collections and joined table inheritance. Due to the fact that:: cols = [c.key for c in [ expression._only_column_elements(q, "mapping_spec")

[sqlalchemy] how to set the initial value for auto_increment?

2012-04-19 Thread Phoebe pei
class MyMode(Base): __tablename__ = 'mymodel' __table_args__ = ({ 'sqlite_autoincrement' : True, }) id = Column(Integer, primary_key=True) def __init__(self, id): self.id = id How can I set the initial value for the id column? -- You received this message because you are subscribed to the Goog

[sqlalchemy] stucco_evolution 0.4 released

2012-04-19 Thread Daniel Holth
stucco_evolution 0.4 has been released. It is a migration tool for SQLAlchemy that attempts to deal with packaged dependencies having their own migration scripts. Reading -> as "depends on", web application -> openid package -> users/groups package web application -> users/groups package When a

[sqlalchemy] automating inheritance

2012-04-19 Thread lars van gemerden
I am trying to my my joined inheritance code clearer, for the dynamic generation of sa classes and tried to do something like this: class InheritMixin(object): @declared_attr def __tablename__(cls): return cls.__name__ @declared_attr def id(cls): if cls.__name__ =

Re: [sqlalchemy] NotSupportedError

2012-04-19 Thread jose soares
Yes, now it works, thanks a lot Michael. :-) j Michael Bayer wrote: func.cast() is not correct. Use the cast() function which handles this special syntax: from sqlalchemy import cast, Integer from sqlalchemy.sql import column from sqlalchemy.dialects import oracle print cast(column('x'), Int