I have a query contains SUBSTRING in where clause:
Select top 100 * from _Doc
where SUBSTRING(_Doc.FileNameStr, 22, 1) = '2'
---
This query runs on mssql but I need to use that query from sa.
I could not find anything like this in SA documentatin.
Here is what I tried so far:
q_doc =
Hello list,
I have the following models (excerpt) which represent a scoring system
(the score is the extra value, it is linked to a scorecard):
class Scoring(Base):
__tablename__ = 'scraper_scoring'
scoring_id = Column('id',Integer, primary_key=True)
extra = Column(Integer,
sqlalchemy.sql.expression.func may work for this:
from sqlalchemy.sql.expression import func
...
q_doc.filter(func.substring(model.Doc.FileNameStr, 22, 1)==search_str)
...
2012/3/8 Timuçin Kızılay t...@savaskarsitlari.org:
I have a query contains SUBSTRING in where clause:
Select top 100 *
Thank you. it works now.
But what is the difference between
from sqlalchemy.sql.expression import func
and
from sqlalchemy import func
the second import is what I found out while experimenting with the query
and after I saw your reply, I tried your code and both works the same.
On
from sqlalchemy.sql.expression import func
from sqlalchemy import func as other_func
func == other_func
True
2012/3/8 Timuçin Kızılay t...@savaskarsitlari.org:
Thank you. it works now.
But what is the difference between
from sqlalchemy.sql.expression import func
and
from sqlalchemy
Hi all,
I was wondering if there is some kind of security announcements mailing
list or anything where we could be informed of security issues directly
from the horse's mouth? :) I did join the mailing list after 0.7.0 was
released so I can't tell if this particular issue was mentioned, a
Hi
My code basically does:
---
engine = create_engine()
table = Table('table', MetaData(), Column('id', Integer, primary_key=True))
table.create(bind=engine)
Session = scoped_session(sessionmaker(bind=engine))
Session.execute(text('SELECT id from table'))
---
The last statement blocks
When augmenting the
basehttp://docs.sqlalchemy.org/en/latest/orm/extensions/declarative.html?highlight=declarative_base#augmenting-the-baseyou
create a class, and then tell declarative_base to inherit from the
class you've created. Ex:
class MyBase(object):
def __init__(self):
#
I'm having issues with certain types of queries in my application that
involve has(), or_(), and composite joins. I've created the most
simple example I could that still produces the error and included it
below. The classes involved in this are fairly contrived, but mirror
my application's real
On Mar 8, 2012, at 1:15 PM, Adam Parkin wrote:
When augmenting the base you create a class, and then tell declarative_base
to inherit from the class you've created. Ex:
class MyBase(object):
def __init__(self):
# code here
Base = declarative_base(cls=MyBase)
class
Mike, can you kickban this retard please.
On 28/02/2012 06:30, Naveen kumar wrote:
Dear IT Professional,
Hope you are doing great,
This is Naveen Kumar from Panzer Solutions, LLC
Chris
--
Simplistix - Content Management, Batch Processing Python Consulting
-
I am running SQLAlchemy under a multithreaded python server (paster),
as part of a web application which is written using the Python Pyramid
framework. When I modify an existing database entry through SQL
alchemy, subsequent page refreshes seem to randomly pick between the
original instance of
On 08/03/2012 16:23, ypg wrote:
I am using a single scoped_session instance to create the sessions,
Can we see some code, small preferably?
which is global to all the threads running in the web application.
That sounds like a really bad idea.
I
can solve this issue by creating a new
On Mar 8, 2012, at 4:23 PM, ypg wrote:
I am running SQLAlchemy under a multithreaded python server (paster),
as part of a web application which is written using the Python Pyramid
framework. When I modify an existing database entry through SQL
alchemy, subsequent page refreshes seem to
On Mar 8, 2012, at 4:34 PM, Chris Withers wrote:
avoid doing that. I'm using a NullPool connection to the database
engine, by the way, just in case that would change anything.
Why would you do that?
I advise using NullPool with SQLite in the docs, if you use SQLA 0.7 the SQLite
dialect
Hi everyone,
I join an application dev team in order to solve 2 main problems with SA on
an application that use SA the wrong way.
Indeed the dev team did not understood that sessions are ad-hoc (as said
by Mike if i remember well).
So they get DetachedInstanceError sometimes on lazy loads.
On Mar 8, 2012, at 4:45 PM, zz elle wrote:
Hi everyone,
I join an application dev team in order to solve 2 main problems with SA on
an application that use SA the wrong way.
Indeed the dev team did not understood that sessions are ad-hoc (as said by
Mike if i remember well).
So
Ah, so it seems I was most confused about the intended usage of the
scoped session - I was assuming that because it was designed to be
multithreaded, that would imply that the same instance would be used
for more than one request ... because an individual request is
typically handled by a single
I found a recipe on stackoverflow for turning a query instance into a
string, including parameters. I only do this for testing purposes and the
implementation is here:
https://bitbucket.org/rsyring/sqlalchemybwc/src/292597b37736/sqlalchemybwc/lib/testing.py
However, I just upgraded to 0.7.5
19 matches
Mail list logo