[sqlalchemy] PickleType to use mediumblob

2011-07-18 Thread rajasekhar911
Hi I want PickleType to use mediumblob instead of blob. i am trying the following from sqlalchemy.databases.mysql import MSMediumBlob class MediumPickle(PickleType): impl = mysql.MSMediumBlob class Task(DeclarativeBase): __tablename__ = 'tasks' context = Column(MediumPickle) is

[sqlalchemy] Re: EOFError while querying

2011-07-06 Thread rajasekhar911
can make use of? Thanks in advance On Jul 5, 6:30 pm, rajasekhar911 rajasekhar...@gmail.com wrote: Hi Michael thanks for the reply. there is a PickleType in the query (the one that i have mentioned as BLOB data type). I have given a test program to the customer and waiting for the response

[sqlalchemy] Re: EOFError while querying

2011-07-05 Thread rajasekhar911
using PickleType even though not indicated here (just a query by itself tells us very little btw) and the EOFError implies the binary data being loaded is not a valid pickle string. On Jul 4, 2011, at 3:09 AM, rajasekhar911 wrote: Hi , I am getting EOFError while querying a table

[sqlalchemy] EOFError while querying

2011-07-04 Thread rajasekhar911
Hi , I am getting EOFError while querying a table . The select contains String fields, integer fields , a BLOB and a TEXT filed. The error happens consistently. This is happening in a customer envt. Anybody has any idea on what could be the issue? Thanks in advance stack trace is given below

[sqlalchemy] how to handle deadlock

2010-05-06 Thread rajasekhar911
Hi I am using sqlalchemy0.5.5 in my TG2 app with mysql(innodb) database My applicaton is multithreaded. there are multiple tasks that run at certain intervals. in one of my tables i am getting the following deadlock error. Deadlock found when trying to get lock; try restarting transaction the

[sqlalchemy] Assertion Error

2010-03-18 Thread rajasekhar911
Hi guys I got this weird AsserstionError and KeyError. It says it is ignored. The class Credential is a mapped as a relation to the parent class. credential=relation(Credential, \ primaryjoin=id == Credential.n_id,\ foreign_keys=[Credential.n_id],\

[sqlalchemy] integrity error in FK relation

2009-12-01 Thread rajasekhar911
i have following relation b/w 3 tables class A(DeclarativeBase) __tablename__='a' id=Column(Unicode(50))#primarykey name=Column(Unicode(50)) cc=relation(C, \ primaryjoin=id == C.b_id,\ foreign_keys=[C.b_id],\ uselist=False,cascade='all,

[sqlalchemy] Re: integrity error in FK relation

2009-12-01 Thread rajasekhar911
but this happen only when i use innodb as engine. didnt give an error on myisam on mysql or sqlite. On Dec 2, 3:12 am, Michael Bayer mike...@zzzcomputing.com wrote: On Dec 1, 2009, at 2:16 PM, rajasekhar911 wrote: i have following relation b/w 3 tables class A(DeclarativeBase

[sqlalchemy] Re: column label and order by

2009-11-17 Thread rajasekhar911
anyone?? On Nov 14, 6:48 pm, rajasekhar911 rajasekhar...@gmail.com wrote: Hi guys, how do i apply order by on a column with a label. My requirement is like this class x   id,   amount,   date i have to group based on id and take sum of amount within a date range. i am applying

[sqlalchemy] Re: column label and order by

2009-11-17 Thread rajasekhar911
session.query( func.sum(x.amount).label('tot_amount'), x.id ). filter(x.datefromdate).filter(x.datetodate). .group_by(x.id) .order_by('tot_amount DESC') .limit(5) On Nov 17, 4:55 pm, Mike Conley mconl...@gmail.com wrote: And you do need to quote the column name in order_by also.

[sqlalchemy] column label and order by

2009-11-14 Thread rajasekhar911
Hi guys, how do i apply order by on a column with a label. My requirement is like this class x id, amount, date i have to group based on id and take sum of amount within a date range. i am applying a label to sum of amount now how do i order based on that so that i can get top 5 ..

[sqlalchemy] a special relation

2009-10-14 Thread rajasekhar911
I have a special kind of relation. Relation = Table(relations, metadata, Column('src_id',Unicode(50)), Column('dest_id',Unicode(50)), Column('relation',Unicode(50)) ) class Node(DeclarativeBase): __tablename__ = 'nodes' name = Column(Unicode(50), nullable=False)

[sqlalchemy] Declarative way of delete-orphan

2009-08-26 Thread rajasekhar911
Hi How do i define a delete-orphan using declarative base? I am using sqlite and SA0.5.5 I have defined a one to one relation. class Child(DeclarativeBase): __tablename__='children' id=Column(String(50),primary_key=True) parent_id=Column(String(50),ForeignKey

[sqlalchemy] Re: index in SA

2009-08-21 Thread rajasekhar911
PM, rajasekhar911 wrote: Hi Is it possible to add index to my table using sqlalchemy? Or should i do it directly on the database? Thanks.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group

[sqlalchemy] Re: index in SA

2009-08-21 Thread rajasekhar911
...@motorola.com wrote: -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of rajasekhar911 Sent: 21 August 2009 07:30 To: sqlalchemy Subject: [sqlalchemy] Re: index in SA i want to add a composite index to the class inherited

[sqlalchemy] Re: index in SA

2009-08-21 Thread rajasekhar911
self.metadata = table.metadata AttributeError: 'NoneType' object has no attribute 'metadata' thanks On Aug 21, 2:22 pm, rajasekhar911 rajasekhar...@gmail.com wrote: hi thanks for the reply.. but one doubt how will i access the MyClass inside MyClass i tried ndex('ix_name_type', MyClass

[sqlalchemy] Re: index in SA

2009-08-21 Thread rajasekhar911
exactly On Aug 21, 2:33 pm, King Simon-NFHD78 simon.k...@motorola.com wrote: -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of rajasekhar911 Sent: 21 August 2009 10:25 To: sqlalchemy Subject: [sqlalchemy] Re: index in SA

[sqlalchemy] index in SA

2009-08-20 Thread rajasekhar911
Hi Is it possible to add index to my table using sqlalchemy? Or should i do it directly on the database? Thanks.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

[sqlalchemy] Re: AttributeError: 'NoneType' object has no attribute 'dict'

2009-08-02 Thread rajasekhar911
...@zzzcomputing.com wrote: theres no way to know unless you can illustrate how to reproduce the   issue fully.      one hunch is that your mappers are not compiled (try   calling compile_mappers()). On Jul 31, 2009, at 3:39 AM, rajasekhar911 wrote: is it because of lazy initialization? I have some

[sqlalchemy] Re: AttributeError: 'NoneType' object has no attribute 'dict'

2009-07-31 Thread rajasekhar911
wrote: theres nothing about the given code that should cause any issue (and I tried it on 0.5.1).    Upgrade to 0.5.5 in any case and that will almost certainly resolve the issue. rajasekhar911 wrote: I am using declarative method to map objects. I am getting the following error when i try

[sqlalchemy] Re: AttributeError: 'NoneType' object has no attribute 'dict'

2009-07-31 Thread rajasekhar911
is it because of lazy initialization? I have some other attributes in my class which are lazy initialized. But these are not mapped to columns. On Jul 31, 11:44 am, rajasekhar911 rajasekhar...@gmail.com wrote: i have upgraded to 0.5.5 Now the error changed to AttributeError: 'NoneType' object

[sqlalchemy] AttributeError: 'NoneType' object has no attribute 'dict'

2009-07-30 Thread rajasekhar911
I am using declarative method to map objects. I am getting the following error when i try to create the object My Class is from sqlalchemy.ext.declarative import declarative_base DeclarativeBase = declarative_base() class User(DeclarativeBase): __tablename__='managed_nodes' id =

[sqlalchemy] single table inheritance through declarative.

2009-07-29 Thread rajasekhar911
Hi I am facing a different problem in inheritance. I am using the single table inheritance through declarative. http://www.sqlalchemy.org/docs/05/reference/ext/declarative.html#single-table-inheritance b=Base() b.id='xxx' b.name='xxx' b.type='type1' I am manually setting the type column of my

[sqlalchemy] relationship between multiple tables in single table

2009-07-06 Thread rajasekhar911
I have 4 tables tbl1, tbl2, tbl3 tbl4. There are OTM MTM (parent-child , friend ...) relations between these tables. Right now each relation has its own MTM table. like tbl1_tbl2, tbl1_tbl3, tbl2_tbl3, tbl3_tbl4, tbl2_tbl4. Is there a way to put all these relations into single table called