I have the following fields defined in a table.
`updated` datetime NOT NULL DEFAULT '1970-01-01 00:00:01',
`deleted` datetime NOT NULL DEFAULT '1970-01-01 00:00:01',
When someone runs SQLACODEGEN it changes the definition of the
server_default time based on the timezone the developer is in
test (t tsvector);
insert into test (t) values (
setweight(to_tsvector('english', 'Thomas Levine'), 'A') ||
setweight(to_tsvector('english', 'blah blah'), 'B')
);
I would use it in the initialization of the Mail model from the same
file as above.
--
SQLAlchemy -
The Python SQL
; actually I don't fancy too much hacking into
the framework. I'll give a shot at CTEs, which I had overlooked in the
docs. They're a good candidate as they give a "procedural" taste to SQL and
this is exactly what I'm trying to do :-)
Thanks a lot for the quick answer!
Thomas
Le 2 janv.
016, at 23:03, Mike Bayer <mike...@zzzcomputing.com> wrote:
>
>
>
> On 09/12/2016 05:30 PM, 'Thomas Gillam' via sqlalchemy wrote:
>> Hello all,
>>
>> I ran into a problem today when running delete() on a query created on a
>> derived polymorphic class. In a
Hello all,
I ran into a problem today when running delete() on a query created on a
derived polymorphic class. In a nutshell, the SQL produced from the batch
delete didn't condition on the polymorphic type, resulting in much broader
deletion than was intended. I'm running SQLAlchemy 1.0.9.
Hello,
which Python 3 compatible MySQL driver is recommended for SA?
I couldn't find a single package which both installs cleanly with pip
and passes the SA test suite. I've tried mysqlclient, mysqlconnector,
cymysql, oursql on OSX.
cheers,
--
You received this message because you are
, Thomas Wanschik twan...@googlemail.com
javascript: wrote:
Thanks for your answer.
I did the exact same raw sql query (got the query string via echo=True)
and it seems like mysql returned an integer (console print looked like a
integer). So I concluded it has to be converted somewhere
Hi,
the query
session.query(func.sum(MyModel.amount)).scalar()
with
MyModel.amount = Column(SmallInteger, nullable=False)
returns a Decimal instead of an integer when using mysql with the default
driver (as well as with the cymysql driver).
How can I get this query to return an integer? And
:44 PM UTC+1, Thomas Wanschik wrote:
Hi,
the query
session.query(func.sum(MyModel.amount)).scalar()
with
MyModel.amount = Column(SmallInteger, nullable=False)
returns a Decimal instead of an integer when using mysql with the default
driver (as well as with the cymysql driver).
How
you can run unittests against the sdk. there's a couple of setup things that
have to be done though. I use the NoseGAE plugin for it.
I don't think sql on gae is available in the sdk yet so there's not really
much that can be done at the moment.
When it does become available I'd be happy to
Hello List
I'd like to define a many-to-many relationship using the declarative
syntax between a table to itself, but employing an association
object (since I require the association to have attributes
also).
Here's what I tried:
, Thomas Jacob ja...@internet24.de wrote:
Hello List
I'd like to define a many-to-many relationship using the declarative
syntax between a table to itself, but employing an association
object (since I require the association to have attributes
also).
Here's what I tried
? This doesn't work:
session.query(MyClass.label(spam))
--
Thanks,
Thomas
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+unsubscr
This is exactly what I was looking for, thank you.
Tom
On Nov 23, 2009 12:42 PM, Conor conor.edward.da...@gmail.com wrote:
Tom Burdick wrote: Ok, here's a small test. It actually works fine when
using sqlite, but not wh...
You can use sqlalchemy.cast() to coerce the type on the DB side:
That was it. Thanks for the quick response!
--~--~-~--~~~---~--~~
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
of parentheses? :
group_concat((anon_2.status order by anon_2.stop))
Any ideas? Using the 'seperator' op instead of the 'order by' produces
a similar error, and the group_concat works without the .op...
Thanks,
-thomas
--~--~-~--~~~---~--~~
You received this message
Wow, my above example sucked. Here's something close to what I'm
actually using:
qs = ...
qunion = qs[0].union_all(*qs[1:]).subquery()
joined = session.query( KnownComponents.name,
qunion,
func.group_concat(qunion.c.status.op('order
Kickass! This is fantastic. Thanks!
--~--~-~--~~~---~--~~
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
Heyo,
Is there any way to specify a particular ordering on a column with the
order by clause (or otherwise)? Something like:
session.query(People).order_by(People.name, ['rick', 'james', 'bob',
'mike'])
Thanks,
-thomas
--~--~-~--~~~---~--~~
You received
Sqlalchemy fits in nicely with pylons, turbogears 2, and repoze.bfg
and I'm sure many others. So you have options.
I wouldn't be able to offer any advice other than that, but spend a
few moments getting familiar with each and you'll probably reach some
conclusion.
On Oct 21, 11:09 am, webdexter
that I've tried using a polymorphic_union (for locating
the value of the polymorphic_on and for primary and secondaryjoin in
relations). That only yields sql code with multiple definitions of
'type'.
Many thanks,
-thomas
---
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import
On Oct 2, 3:41 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Thomas Drake wrote:
primary = dep_groups.join(dep_group_components,
dep_groups.c.group_id==dep_group_components.c.group_id).join
(dependencies_table,
dep_group_components.c.group_id==dependencies_table.c.parent_id
trying to have an elaborate set of
rules to figure out how to convert each column to its correct type, I
thought there might be a robust way of doing this that just uses the
existing column definition to figure out which numpy type to use?
Thanks for any help,
Thomas
column not be 300.156 since I specified scale=3? Am I
doing something wrong?
Thanks for any help,
Thomas
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy
From the example here:
http://www.sqlalchemy.org/docs/04/documentation.html#datamapping_manytomany
How can i construct a query that will return the keywords for posts
from
a particular user?
I'd expect this to work:
session.query(Keyword).join(BlogPost.keywords) \
Hi!
I'm replacing some relation()s by dynamic_loader()s and encountered
the problem that the order_by parameter doesn't work anymore.
Obviously dynamic_loader doesn't support it.
Is this left out with a special purpose? I'd find it quite useful to
have a default ordering for the related
Hi!
As I can also use several list operations on a Query instance (like
access by index, slicing, ...) it might be a good idea to add __len__,
so that I can use the pythonic len(query).
The patch would be trivial (unless there are some internal issues that
I don't know).
Just add this method to
Hi!
I'm trying to filter my data by some date calculations.
In detail, I want to filter out messages that have been marked as
deleted more than 30 days ago.
In a query I could do it like this:
threshold = datetime.now() - datetime.timedelta(30)
return
If you want to count the children of a parent entity you can do it
like that:
parent.children.count(Child.id)
Generally, this is fine. But it loads all children into the session
and then manually counts them.
For large sets this will become very slow.
Wouldn't it be smarter to do the count
On Oct 16, 7:42 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Oct 16, 2007, at 1:30 PM, [EMAIL PROTECTED] wrote:
Am I really supposed to save/flush/clear/query my objects to get the
correct mappings?
Or is this a bug?
the advised pattern here is the
association object pattern
On Oct 17, 12:21 pm, Thomas Wittek [EMAIL PROTECTED] wrote:
mapper(Participation, participation_table,
properties=dict(
user=relation(User, backref='participations')
)
)
Should be:
mapper(Participation, participation_table
Hello,
I was wondering if there is a special reason to wrap the db api
exceptions like e.g. IntegrityError into an SQLError.
The code could execute self._autorollback() and just rise the
exception again.
This would make much nicer exception handling (at least for me) in
situations like
32 matches
Mail list logo