[sqlalchemy] Re: relationship problem

2011-07-13 Thread mik
Hello Simon, I have tried to do what you told me and get now the error: sqlalchemy.exc.ArgumentError: Could not determine join condition between parent/child tables on relationship Famprod.activite. Specify a 'primaryjoin' expression. If 'secondary' is present, 'secondaryjoin' is needed as

[sqlalchemy] default value from column

2011-07-13 Thread ddarko
class AccountHistory(Base): id = sa.Column(sa.types.Integer, primary_key=1) date= sa.Column(sa.types.DateTime, nullable=0, default=sa.func.current_timestamp()) type= sa.Column(sa.types.Integer, nullable=0,

Re: [sqlalchemy] default value from column

2011-07-13 Thread Will Weaver
I'm not positive about this but if you are talking about the integer column, all defaults have to be a string or some SQLAlchemy function so you'd want: type = sa.Column(sa.types.Integer, nullable=0, default='1') On Wed, Jul 13, 2011 at 7:37 AM, ddarko ddarko...@gmail.com wrote: class

[sqlalchemy] Re: Sqlalchemy declarative_base()

2011-07-13 Thread ddarko
On Jul 12, 5:40 pm, Dipo Elegbede dipo.elegb...@gmail.com wrote: Can I create two tables under a single Base class. Yes. If Base is the Base class then: class Tab1(Base): name = Column(String) extension = Column(String) class Tab2(Base): name = Column(String) extension =

[sqlalchemy] Re: Sqlalchemy declarative_base()

2011-07-13 Thread ddarko
On Jul 12, 5:40 pm, Dipo Elegbede dipo.elegb...@gmail.com wrote: I would appreciate if you point me to any relevant documentation. http://www.sqlalchemy.org/docs/orm/extensions/declarative.html?highlight=declarative_base -- You received this message because you are subscribed to the Google

[sqlalchemy] Re: default value from column

2011-07-13 Thread ddarko
I do not want to define a column with a default value and use it. Just I would like to write my own validator and I need to get the default value of already-defined table. SQLAlchemy 0.7.1 On Jul 13, 2:26 pm, Will Weaver willman...@gmail.com wrote: I'm not positive about this but if you are

Re: [sqlalchemy] Re: default value from column

2011-07-13 Thread Mike Conley
given Column('status', String(1), default='A') Column('num', String(10), nullable=False, server_default='000') try table.status.c.default.arg for sqlalchemy managed arguments or table.num.c.server_default.arg for database managed defaults Remember to test that the .default

[sqlalchemy] Re: default value from column

2011-07-13 Thread ddarko
On Jul 13, 3:47 pm, Mike Conley mconl...@gmail.com wrote: given Column('status', String(1), default='A') try         table.status.c.default.arg AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object has an attribute 'c' I'm using the Declarative ORM Extension. It

[sqlalchemy] Re: default value from column

2011-07-13 Thread ddarko
I did it this way: class AccountHistory(Base): id = sa.Column(sa.types.Integer, primary_key=1) date = sa.Column(sa.types.DateTime, nullable=0, default=sa.func.current_timestamp()) type = sa.Column(sa.types.Integer, nullable=0, default=1) def getdefault(self, name):

[sqlalchemy] Re: relationship problem

2011-07-13 Thread mik
Hello, After many try, putting the table name in lower case in my code solve my little problem. I get the solution in the oracle/base.py header. I have not fully understood the conventions rules but this problem show me that this part in sqlalchemy / oracle is important. Mikael. -- You

RE: [sqlalchemy] information about filed create_engine

2011-07-13 Thread King Simon-NFHD78
Eduardo wrote Hi, I am trying to prompt an answer from a database after failed create_engine command. I searched through the source code and I found TypeError, and ValueError returns but they relate (if I understood well only to the access parameters). My problem is that I am sure that my