[sqlalchemy] Re: SQL Alchemy TypeDecorator

2022-08-09 Thread 'Jonathan Vanasco' via sqlalchemy
This is usually done in the ORM with functions, and possibly hybrids. See https://docs.sqlalchemy.org/en/14/orm/mapped_attributes.html On Tuesday, August 9, 2022 at 1:55:45 PM UTC-4 Justvuur wrote: > Hi there, > > Is there a way to pass/access model data for a row within the " >

[sqlalchemy] Re: SQL Alchemy Closure Table Relationship Definition

2012-01-10 Thread jonstjohn
Thanks for persisting with me - your solution was almost perfect, and really pointing me in the right direction. Below is what eventually worked: areas = relationship('DbArea', backref = backref('routes', order_by = 'DbRoute.name'), secondary = area_relationship_table,

[sqlalchemy] Re: SQL Alchemy Closure Table Relationship Definition

2012-01-09 Thread jonstjohn
Michael - I greatly appreciate the time and consideration you put into your thorough reply. It has really helped me better understand how SQL Alchemy handles associations. In particular, it is now apparent to me that there is no clear association between area and route, which makes it not

Re: [sqlalchemy] Re: SQL Alchemy Closure Table Relationship Definition

2012-01-09 Thread Michael Bayer
On Jan 9, 2012, at 11:58 PM, jonstjohn wrote: The route and area relationship is similar to the hypothetical problem of a business location. Suppose you have a set of business locations, each in a specific city. The business must be associated with one and only one city. The city is

[sqlalchemy] Re: SQL Alchemy Out of memory (re-posted)

2011-03-31 Thread Harish Tejwani
Turning on logging gives lots of logs, anyway we also thought that self.all() is returning a very large data-set (we don't have BLOBs) Are there any limits and is there anyway we can increase the memory here, maybe of python process itself Is there any other solution you suggest if select itself

Re: [sqlalchemy] Re: SQL Alchemy Out of memory (re-posted)

2011-03-31 Thread Michael Bayer
usually applying limit() to the select is the solution for that On Mar 31, 2011, at 8:14 PM, Harish Tejwani wrote: Turning on logging gives lots of logs, anyway we also thought that self.all() is returning a very large data-set (we don't have BLOBs) Are there any limits and is there anyway

[sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-19 Thread dhanil anupurath
Hi thanks for the quick reply and pointing me in the right direction. it seems the error is actually related to the operator. is there anything SA can do on this issue? In the meantime i am going to change my query. thanks again.. -- You received this message because you are subscribed to

Re: [sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-19 Thread Michael Bayer
I'm not familiar with the operator in Oracle or its syntax. The first step would be to create a cx_oracle sample script that emits the exact SQL you're looking for. We could then see how to adapt it to SQLAlchemy. On May 19, 2010, at 2:45 AM, dhanil anupurath wrote: Hi thanks for the

Re: [sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-18 Thread dhanil anupurath
Hi SORRY for the delay to reply. Here is what my definitions. These are my class and table definitions: class Task(DeclarativeBase): task_id = Column(Integer,Sequence('id_ seq'), primary_key=True) task_type = Column(Unicode(50), default=to_unicode('Task')) name =

[sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-18 Thread dhanil anupurath
Hi task = Task(u'Task',\ {'quiet':False}, [], {}, None, u'admin') model.DBSession.merge(task) in my database the following query will try to select the above task object and result in error DBSession.query(TaskCalendar).options(eagerload('task')).\

Re: [sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-18 Thread Michael Bayer
attached is a test program that is of a format which allows us to be able to answer your questions quickly. It is a short test program that runs fully, using the model fragments you've sent along. It does not reproduce your error. Instead, it appears that the is not an operator accepted

[sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-10 Thread dhanil anupurath
Hi This is my class definition class TaskCalendar(DeclarativeBase): __tablename__ = 'task_calendars1' cal_id = Column(Integer,Sequence('id_seq'), primary_key=True) task_id = Column(Integer, ForeignKey('tasks.task_id')) dow = Column(Integer) month = Column(Integer) day =

Re: [sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-10 Thread Michael Bayer
This is not enough detail to provide any insight into your issue. We would require the mapping for TaskCalendar, Tasks, as well as code which inserts the offending data into the database and then issues your query, reproducing the error you are getting. On May 10, 2010, at 8:54 AM, dhanil

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-18 Thread Christian Démolis
Hello, Thx for the answer, thx to Alexandre to translate my mail. Sorry, i continue in english, i tried to do that at the end of my declaration file : Base.metadata.create_all(engine) import sqlalchemy.orm.query class MyQuery(sqlalchemy.orm.query.Query): def __init__(*arg, **kw):

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-18 Thread Alexandre Conrad
In Python, you have to pass self as first argument to all methods of a class: class MyQuery(sqlalchemy.orm.query.Query): def __init__(self, *arg, **kw): ... Alex 2009/9/18 Christian Démolis christiandemo...@gmail.com: Hello, Thx for the answer, thx to Alexandre to translate my

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-18 Thread Christian Démolis
^^ I m so shameful It works very well now. I post the subclass complete if anyone need it in future Base.metadata.create_all(engine) import sqlalchemy.orm.query from sqlalchemy.orm.query import Query class Query(Query): def __init__(self, *arg, **kw): print I pass here

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-17 Thread Alexandre Conrad
2009/9/17 Christian Démolis christiandemo...@gmail.com: How can i force sqlalchemy to refresh an object when i did a session.query??? You may want look at this: http://www.sqlalchemy.org/docs/05/session.html#refreshing-expiring You may, as well, look at expunging. Alex

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-17 Thread Christian Démolis
Bonjour, Tu es français je pense au vu de ton prénom. Je continue donc en français. En fait j'ai 25000 lignes de codes derrière moi et j'aimerai éviter d'avoir à ajouter tous les refresh ou les session.query().populate_existing() partout dans mon code J'ai tenté en vain de surcharger la méthode

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-17 Thread Michael Bayer
Alexandre Conrad wrote: Christian, 2009/9/17 Christian Démolis christiandemo...@gmail.com: Bonjour, Tu es français je pense au vu de ton prénom. Je continue donc en français. Nice guess. I understand it feels more comfortable writing in French rather than in English, but many people

[sqlalchemy] Re: SQL Alchemy

2006-12-08 Thread Robin Munn
On 12/4/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Can you use real numbers and date into SQL Alchemy database? In a word: yes. For real numbers, you'd use the Float() column type, and for dates, you'd use the Date() column type. (Or the DateTime() column type if you wanted both a date and