[sqlalchemy] Class.query vs DBSession.query(Class)

2009-02-26 Thread Sanjay
. Are there any disadvantages? Also refer http://groups.google.co.in/group/turbogears/browse_thread/thread/8f3b4c4da33d69c8 thanks, Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group

[sqlalchemy] High resolution SQLAlchemy logo

2008-05-02 Thread Sanjay
Hi, I think to print SQLAlchemy logo on our company brochure. I think it is permissible. Is not so? Is there a high resolution logo somewhere? thanks Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Getting error while using MapperExtension

2008-04-08 Thread Sanjay
initialization It gives me the following exception: TypeError: ('Task' object is unsubscriptable... Needing help. thanks Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group

[sqlalchemy] Re: Getting error while using MapperExtension

2008-04-08 Thread Sanjay
For your call to mapper.populate_instance, you have the arguments for 'row' and 'instance' reversed. Yes! reversing it works perfectly. I had guessed the argument sequence from the MapperExtension.populate_instance, which happens to be reverse. thanks a lot! Sanjay

[sqlalchemy] SQLALchemy used at gcollab

2007-12-21 Thread Sanjay
and support. Sanjay --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED

[sqlalchemy] Re: concurent modification

2007-11-22 Thread Sanjay
I think all one can do is just forget and start over again, when concurrent modifications error occurs. That means, catchig the exception and just showing some failure message to the user is all one can do. Sanjay --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Re: Looking for feedback on encapsulating SA logic (newbie)

2007-10-29 Thread Sanjay
mapper(User, users_table) Is not using assign_mapper preferable? --~--~-~--~~~---~--~~ 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 unsubscribe

[sqlalchemy] Re: session issues in TG - automatic commits happening.

2007-06-26 Thread Sanjay
As I recall, this was discussed in TG forum sometime, and there is a nice way to disable this. Searching there might help... Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

[sqlalchemy] Re: Concurrency control using version_id_col

2007-06-26 Thread Sanjay
Hi Mike, Thanks a lot. It works fine (with or without default=0). The problem was in my TG application, which was not preserving version while populating the edit form. I made version as a hidden field in the form, and it works fine now. Sanjay

[sqlalchemy] Concurrency control using version_id_col

2007-06-21 Thread Sanjay
=False), . . Column('version', Integer, default=0)) 2. Mapping like this: assign_mapper(session.context, Page, page_tbl, version_id_col=page_tbl.c.version, properties={...}) But it does not seem working. Are we missing any step? thanks Sanjay

[sqlalchemy] Re: In Turbogears, using the same transaction for mapped objects and direct operations

2007-06-07 Thread Sanjay
So, cherrypy.request.sa_transaction.connection should work. I had tries that. But it says Exceptions :'function' object has no attribute 'execute' Don't know why. Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[sqlalchemy] Re: In Turbogears, using the same transaction for mapped objects and direct operations

2007-06-06 Thread Sanjay
conn = session.context.get_current().connection(SomeMappedClass) conn.execute(...) Thanks! It is exactly what I needed. BTW, the session transaction is stored in cherrypy.request.sa_transaction. Does this help simplify the statements? thanks again, Sanjay

[sqlalchemy] In Turbogears, using the same transaction for mapped objects and direct operations

2007-06-05 Thread Sanjay
where db entities like metadata and session are imported rather than created by me, I am confused and could not successfully implement the pattern provided in the docs. thanks, Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Re: Calling a function (Stored Procedure) returning a recordset

2007-05-15 Thread Sanjay
Thanks a lot, Michael and Eric! This long thread has been quite useful to me. Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy

[sqlalchemy] Re: Calling a function (Stored Procedure) returning a recordset

2007-05-13 Thread Sanjay
, primary_key=True, autoincrement = True), Column('first_name', Unicode(30)), Column('last_name', Unicode(30))) metadata.drop_all() metadata.create_all() class Person(object): pass assign_mapper(context, Person, person_table) p1 = Person(first_name=Sanjay, last_name=Patel) p2

[sqlalchemy] Re: Calling a function (Stored Procedure) returning a recordset

2007-05-11 Thread Sanjay
('person_id', Integer, primary_key=True, autoincrement = True), Column('first_name', Unicode(30)), Column('last_name', Unicode(30))) metadata.drop_all() metadata.create_all() class Person(object): pass assign_mapper(context, Person, person_table) p1 = Person(first_name=Sanjay, last_name=Patel

[sqlalchemy] Re: 'MapperExtension' object has no attribute 'translate_row'

2007-05-04 Thread Sanjay
testcase please Here is the sample code which works perfectly till 0.3.4 and produces error in newer versions in my system: from sqlalchemy import * from sqlalchemy.ext.assignmapper import assign_mapper from sqlalchemy.ext.sessioncontext import SessionContext context =

[sqlalchemy] Re: 'MapperExtension' object has no attribute 'translate_row'

2007-05-04 Thread Sanjay
: class TaskExtension(MapperExtension): Thanks a lot Simon, Michael! I did not read the documentation properly and had missed the inheritence. It indeed makes life a lot simpler. thanks Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Re: Calling a function (Stored Procedure) returning a recordset

2007-05-02 Thread Sanjay
get_tasklist(). So, probably the question is, What SQLAlchemy code will translate to SELECT * FROM get_tasklist(). Needing suggestions. thanks Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

[sqlalchemy] Calling a function (Stored Procedure) returning a recordset

2007-05-01 Thread Sanjay
that cannot accept a set\nCONTEXT: PL/pgSQL function get_tasklist line 6 at return next\n', bound method TaskController.get_tasks of gcollab.controllers.task.TaskController object at 0xb742716c) 'SELECT get_tasklist()' {} Am I calling the stored procedure correctly? Need help. thanks Sanjay

[sqlalchemy] 'MapperExtension' object has no attribute 'translate_row'

2007-04-28 Thread Sanjay
Hi, While updated from version 0.3.3 to 0.3.6, I am getting this error: 'MapperExtension' object has no attribute 'translate_row' A bug? Any clues would help. thanks Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Is it possible to know the size of a deferred PickleType?

2007-03-06 Thread Sanjay
Hi All, Wondering if it is possible to know the size of a file stored in a deferred column (PickleType), without retrieving the file itself. Thanks in advance. Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[sqlalchemy] Re: Is it possible to know the size of a deferred PickleType?

2007-03-06 Thread Sanjay
I usually try to save the filesize as a separate column. Hi Sean, Thanks for the suggestion. I think that might be the only way to know a filesize without retrieving a file. Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Re: Running initialization code after creating/loading an object

2007-03-02 Thread Sanjay
Hi Rick, This was exactly what I needed. Thanks a lot! Sanjay (I think I wrote this message yesterday also, which did not appear. Might have pressed the discard button?!) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[sqlalchemy] Running initialization code after creating/loading an object

2007-02-26 Thread Sanjay
create_instance(self, mapper, selectcontext, row, Person): p = Person() p.CallAfterInitializationOrFetchingFromDatabas() return p assign_mapper(context, Person, person_table, extension=PersonExtension()) p = Person.Create(first_name=Sanjay, last_name=Patel) Assert p.full_name

[sqlalchemy] Re: Full Text Search using PostgreSQL and tsearch2

2007-02-01 Thread Sanjay
creeped in. It might take some more time. Till then if somebody does this, kindly post in the wiki. thanks Sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

[sqlalchemy] Re: new docs new docs new docs

2007-01-22 Thread Sanjay
of willingness and ability in an open-source developer. Fully seconded. I take SQLAlchemy as a boon to IT industry - particularly while talking Agile development. I can't think agile python frameworks entering enterprise level without it. sanjay --~--~-~--~~~---~--~~ You

[sqlalchemy] Re: Full Text Search using PostgreSQL and tsearch2

2007-01-19 Thread Sanjay
Thanks a lot, guys. Will try a sample application and post in the wiki. Might take some time - meanwhile, if somebody gets some more stuff, posting it would help. thanks sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Full Text Search using PostgreSQL and tsearch2

2007-01-18 Thread Sanjay
) for a project and it works quite well., but I am not being able to guess the pattern. thanks sanjay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy

[sqlalchemy] Re: PostgreSQL - fetching boolean type gives integer type

2006-12-22 Thread Sanjay
. Understanding SA docs recommending psycopg2, a few days back I had tried to install it. But it gave some error, and I decided not to bother and be happy with psycopg, as it was working without problems for me for last few months. That was the mistake, which drained this timeeffort of all of us. thanks sanjay

[sqlalchemy] table_foo.c.column_foo.autoincrement returning True always

2006-12-22 Thread Sanjay
system, or it's a bug. thanks sanjay --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL

[sqlalchemy] Re: table_foo.c.column_foo.autoincrement returning True always

2006-12-22 Thread Sanjay
))) metadata.create_all() assert company_tbl.c.company_id.autoincrement == True assert company_tbl.c.name.autoincrement == True# passes! assert company_tbl.c.name.autoincrement == False # fails! sanjay --~--~-~--~~~---~--~~ You received this message because

[sqlalchemy] PostgreSQL - fetching boolean type gives integer type

2006-12-21 Thread Sanjay
: (ProgrammingError) ERROR: column show_ads is of type boolean but expression is of type integer What happens is, while fetching, boolean columns are fetched as integer type (0, 1). I don't know whether it is the expected behaviour or a bug. Bringing to notice, in case it is a bug. thanks sanjay

[sqlalchemy] Re: PGBigInteger behaving like Integer

2006-12-15 Thread Sanjay
Thanks! Again I am overwhelmed by the excellant response!! sanjay --~--~-~--~~~---~--~~ 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 unsubscribe

[sqlalchemy] Configuration of SelectResults: per Query, per Mapper, or per application?

2006-12-14 Thread Sanjay
I am implementing @paginate in a few places in a turbogears application, which needs SelectResults. Wondering whether to configure it for per Query, per Mapper, or per application mode. Seeking suggestions on advantages and disadvantages of each. thanks sanjay

[sqlalchemy] Re: SA 0.3.x: performance issues

2006-12-05 Thread Sanjay
instance changes get picked up. if you want the more simplistic comparison method (i.e. using is), set up your PickleType with the flag mutable=False. You meant like this? Column('content', PickleType, mutable=False) thanks sanjay

[sqlalchemy] Selection criteria in a property(one-to-many) of a mapped object

2006-12-05 Thread Sanjay
refering to all pages of an website website.pages(where page_id = 1) # what is the ideal way to do this website.pages(where created_at 21-DEC-2006) # and this pages being a python list, searching for thing iteratively could do the job, but would involve many database fetches. thank sanjay