Congratulations Mike!
I must say that I am impressed (and always have been) by the amount of
dedication you have put into SQLAlchemy over the years and everything you
built around it, documentation, community, ... I can't think of any other
open source project that has such a high degree of
Hey Mike,
Thanks the fantastic work you have been offering to the open source
community over the years ! I am personally very grateful and I am sure a
lot of people think the same.
Maybe should you jump directly to version SQLA 1.1 as people think 1.0
versions are still immature and they would
Congrats Mike for all this great work!
2012/10/30 Michael Bayer mike...@zzzcomputing.com
The first beta release of the SQLAlchemy 0.8 series, 0.8.0b1, is released
for developer evaluation.
0.8 represents the latest series of refinements to the SQLAlchemy Core and
ORM libraries and features
Hi list,
So I am working on a project with SQLAlchemy using MSSQL as a back-end
DB and I need to add a WITH (nolock) statement to all my queries
implicitly. Even for the .get(pk_id) method. Mike actually pointed me
to the .with_hint() method on the Query object but I couldn't get it
to work.
PS:
, at 12:55 PM, Alexandre Conrad wrote:
Hi list,
So I am working on a project with SQLAlchemy using MSSQL as a back-end
DB and I need to add a WITH (nolock) statement to all my queries
implicitly. Even for the .get(pk_id) method. Mike actually pointed me
to the .with_hint() method on the Query
Not sure on this one, but are you passing a formatted date string? Maybe you
should set a datetime object directly and let SA do the string conversion
during flush.
Alex
Sent from my fantastic HTC Hero
On Oct 28, 2010 1:41 AM, KLEIN Stéphane klein.steph...@gmail.com wrote:
Hi,
in my project,
This is amazing work! Thanks Mike. I am truly flabbergasted (heh, I
always wanted to use that word somehow).
How many tests are there?
2010/10/24 Michael Bayer mike...@zzzcomputing.com:
Greetings -
SQLAlchemy 0.6.5 is released. As we approach towards the start of 0.7,
where a good
This is the documentation for self referential mapper:
http://www.sqlalchemy.org/docs/mappers.html#adjacency-list-relationships
I guess you have found the recipes for doing it the declarative way.
2010/8/26 waugust waugustyn...@gmail.com:
I'm guessing that the answer would be as at:
flush is not commit. After a flush, you can still rollback.
2010/7/24 manman ne.man...@gmail.com
if use flush() then how to rollback ?
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
2010/5/30 Krishnakant Mane krm...@gmail.com:
So I asume that 0.6.0 is pritty stable.
Is all the documentation upto date?
SQLAlchemy 0.6's documentation is up-to-date and probably is one of
the best documentation in the Python eco-system.
--
Alex
twitter.com/alexconrad
--
You received this
2010/4/14 Sebastian Elsner sebast...@risefx.com:
I am unsure on how to delete correctly. Lets say I have a query's result,
which is a list. del list[5] does not seem to do anything, right? I would
always have to do session.delete(list[5])?
Correct. del list[5] only delete the instance in
How about just a:
cities = session.query(City).all()
for city in cities:
session.delete(city)
or
for city in session.query(City): #actually fires the query
session.delete(city)
or even (never tried that, read from the docs):
session.query(City).delete()
Alex
2010/2/26 Marcin Krol
2010/2/26 Marcin Krol mrk...@gmail.com:
mapper(City, city_table, properties={'users':relation(User,
order_by='user_.id', backref='city_backref')})
Isn't it
order_by='user.id'
?
--
Alex
twitter.com/alexconrad
--
You received this message because you are subscribed to the Google Groups
2010/2/26 Marcin Krol mrk...@gmail.com:
Sure, it can be done and I'm doing that: I'm just saying that it wouldn't
hurt if you could pass a list to session.add or session.delete instead of
handing objects over one by one.
For adding, there's the .add_all(instances) method available.
There's no
Hello,
Problem figured out: I opened an issue on Distribute (the setuptools fork):
http://bitbucket.org/tarek/distribute/issue/99/easy_install-uses-setupcfg-if-in-working
Regards,
Alex
2009/12/2 Alexandre Conrad alexandre.con...@gmail.com:
Ok, I have my finger on the problem. From
Hey there,
just wondering:
easy_install SQLAlchemy
downloads and installs version 0.5.2. Shouldn't it be 0.5.6?
Regards,
Alex
--
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.
+0100, Alexandre Conrad pisze:
Hey there,
just wondering:
easy_install SQLAlchemy
downloads and installs version 0.5.2. Shouldn't it be 0.5.6?
# easy_install SQLAlchemy
Searching for SQLAlchemy
Reading http://pypi.python.org/simple/SQLAlchemy/
Reading http
, Alexandre Conrad alexandre.con...@gmail.com
wrote:
2009/11/27 gizli mehm...@gmail.com:
With mysql however, the insert done by the query() actually does a
commit.. i turned on ec...
-- You received this message because you are subscribed to the Google Groups
sqlalchemy group. To...
--
You
2009/11/27 gizli mehm...@gmail.com:
With mysql however, the insert done by the query() actually does a
commit.. i turned on echo, and i dont see an explicit commit but this
is what seems to happen.. After the program is done, I can see Obj(5)
in the mysql database.
Is this a known problem?
2009/9/28 Christian Démolis christiandemo...@gmail.com:
I need it to avoid write this in my code
for e in s:
print e[0]
it's more difficult to read than
From a readability point of view, you could use unpacking in your loop:
for foo, bar in ((foo1, bar1), (foo2, bar2)):
... print
change the code of
sqlalchemy itself, please help me.
2009/9/17 Michael Bayer mike...@zzzcomputing.com
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
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
Keep in mind that the method on your Bar class:
def all_foo(self):
foo_query.all()
will return a raw *list* of Foo objects. If you append more Foo
objects to it, they won't be seen by SQLAlchemy's session, thus not
being commited. Although, if you have set on your mapper:
2009/9/10 Wolodja Wentland wentl...@cl.uni-heidelberg.de:
Class Bar(object):
def all_foo(self):
foo_query.all()
def foo_startwith(self, search_string):
foo.query.filter(tbl.c.col.like('%s%%'% ...))
Note that a .startswith() method is already implemented in SA:
Hello Adrian,
In my case, I actually build up my SA model, flush it, and save the
file on disk using the id that's been populated on my object after
flush.
Sorry, your original question didn't really give enough details on
what you wanted to do. What you were trying to achieve is not common
Don't you want that non-null column to be a foreign key ?
2009/5/21 Adrian von Bidder avbid...@fortytwo.ch:
Hi,
Is it possible to fetch the values of an autoincrement field without
flushing the object to the DB?
(In postgres, I obviously can manually fetch nextval of the automatically
Hello Adrian,
2009/5/22 Adrian von Bidder avbid...@fortytwo.ch:
On Friday 22 May 2009 08.43:09 Alexandre Conrad wrote:
Don't you want that non-null column to be a foreign key ?
Would that make a difference?
That's what a foreign key is used for: http://en.wikipedia.org/wiki/Foreign_key
I
Could you please send your SQLAlchemy tables you are working with to
have a better idea of what's you want to achieve ?
2009/5/22 Adrian von Bidder avbid...@fortytwo.ch:
On Friday 22 May 2009 13.58:34 Alexandre Conrad wrote:
Hello Adrian,
2009/5/22 Adrian von Bidder avbid...@fortytwo.ch
Mike,
Woooh ! it all sounds sounds great !
I was thinking that it would be nice to have an up-to-date version of
your post you did a while back:
http://techspot.zzzeek.org/?p=17
I know such a task takes time but it would be fun to see the results.
That would keep SA's marketing in shape (even
So, does sqlalchemy support self 2 self relationship ?
If the answer is YES, how to do it?
You may want to look at the remote_side keyword argument.
http://www.sqlalchemy.org/docs/05/mappers.html#adjacency-list-relationships
Regards,
Alex
As I said in my previous mail, you really should look at the
remote_side keyword argument in your relation. This is what it was
done for and the paragraph adjacency-list-relationships from the
documentation covers all you need to know to deal with
self-referential relationships.
Here's the link
#advdatamapping_relation_selfreferential
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
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
you on track.
Regards,
--
Alexandre CONRAD
Max Ischenko wrote:
Hello,
I'm struggling with a simple one to many relation, pls help!
active_meetup = MeetupEvent(...)
reg = MeetupRegistration(meeting=active_meetup)
db.save(reg)
class 'sqlalchemy.exceptions.OperationalError
Then I don't know. :)
Max Ischenko wrote:
On 29 янв, 10:47, Alexandre Conrad [EMAIL PROTECTED] wrote:
Hello Max,
AFAIR, I've had similar problems latelty when having a table with
composite primary keys and running SQLite. I think Mike told me SQLite
didn't support that. I'm no SQLite user
do, try to find the
relation with it. Then figure out that the 'site_client' table is mapped
to SiteClient, and keep on finding the next relation 'playlists' to join
it with.
Good night, and good luck. :)
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You
(), which Im trying to do now, as show above.
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
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
on Channel; WHERE CatalogChannel.c.id_channel==foo.
This is just an idea, but here the join with CatalogChannel.id would
mean that is need to figure out that PK is also FK to Catalog.
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because
running a
under a foo table with MySQL. (another hidden bug, I'm getting
(IntegrityError) medias.id may not be NULL).
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group
Alexandre Conrad wrote:
under a foo table with MySQL. (another hidden bug, I'm getting
a foo schema/db, not table.
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
as
primary_key=True on both columns).
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
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
tables for
doing the joins. I remember I already played with that select_from
syntax, which was working.
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
Mike,
My day is over, I'm leaving the office. I'll read your replies tomorrow.
Thanks for taking some time one that.
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group
= catalog_channels.id
which
.filter(Catalog.c.id==catalog_channel_table.c.id)
generates correctly when explcitly pointing the wanted table. Is that a
bug Mike ?
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you
Michael Bayer wrote:
On Jan 13, 2008, at 1:02 PM, Alexandre Conrad wrote:
Anyway, my inital issue according to the subject's title, is that:
.filter(Catalog.c.id==CatalogChannel.c.id)
generates the SQL query
catalogs.id = catalogs.id
rather than the expected
catalogs.id
svilen wrote:
On Friday 11 January 2008 16:12:08 Alexandre Conrad wrote:
Channel - Playlist - Media
Channel - CatalogChannel(Catalog) - Media
(Media has a fk to Catalog, not CatalogChannel)
The only element I have, is playlist (instance of Playlist). At
this point, I need to find out
type column from Catalog, but it doesn't. Mike suggested
we would need to extend the API with a new method like
join_to_subclass() or so... Even though, I still think SA should figure
out which relation I'm looking at...
Regards,
--
Alexandre CONRAD
. The part where
.filter(Catalog.c.id==CatalogChannel.c.id)
wrongly generates:
catalogs.id = catalogs.id
So I need to use the table itself:
.filter(Catalog.c.id==catalog_channel_table.c.id)
correctly generates:
catalogs.id = catalog_channels.id
This works.
Regards,
--
Alexandre CONRAD
JOIN addresses ON addresses.id = companies.id_address LEFT OUTER JOIN
addresses AS addresses_1 ON addresses_1.id = companies.id_address
[...]
Sorry, I forgot to check the trunk before sending to the list...
Regards,
--
Alexandre CONRAD - TLV FRANCE
Research Development
?
Test case attached. Thank you.
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
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
):
#site_mapper = mapper(Site, site_table, inherits=Company,
polymorphic_identity='site')
site_mapper = mapper(Site, site_table, polymorphic_on=site_table.c.type,
polymorphic_identity='site')
Is that possible ?
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You
Alexandre Conrad wrote:
Here is the code I'm working on (sqlite and mysql errors at the bottom):
http://rafb.net/p/HlZw3P26.html
Here are the relations for clarity:
client(company) -- one-to-many - site(company)
client(company) -- one-to-many - channel(object)
query == site - client
much mind twising. But maybe this has already been
standardized somehow. Any idea how this can be achieved ?
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
://www.sqlalchemy.org/docs/04/mappers.html#advdatamapping_relation_customjoin
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy
Hi,
I've attached a test script as I'm confused with what I'm trying to do.
I have the following scenario:
- A Channel object is TV channel:
class Channel:
pass
- A Playlist object is a piece of a channel's TV program.
class Playlist:
pass
- A Playlist can be declined as different
on the FormAlchemy list:
http://groups.google.com/group/formalchemy
:)
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy
://formalchemy.googlecode.com
Mailing list: http://groups.google.com/group/formalchemy
Feedback is appreciated. :)
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group
the actual query. Anyway, all this is nicely
documented... :)
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy
Okay Mike,
about scoped_session(), I think I got it right this time. I was trying
to get inspired from SAContext, how it's beeing wrapped around with
Pylons. Since SAContext has not yet upgraded to SA 0.4, maybe I was just
getting inspired from some different mechanism. Or SAContext it doing
Michael Bayer wrote:
I've implemented all the missing class-level methods on
ScopedSession in r3212, so you should be able to call refresh().
Great, thanks. I'll check this out.
But also, if you want to say Session(), then work with it, that is
also the intended usage model, although
Alexandre CONRAD wrote:
Don't forget to answer my question: What are the benefits of
instantiating a Session object ?. Actually, I just feel better working
*with* a instantiated object.
Hey, I just set my code to instantiate the session, and I get the
following error when I delete
Michael Bayer wrote:
Hey, I just set my code to instantiate the session, and I get the
following error when I delete a client (which has a bunch of cascading
all, delete-orphan rules).
session = Session()
NB: I've mapped the session.delete function to my model object for
convenience:
doing something wrong.
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
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
This *IS* some piece of work ! Mike, you are the One ! :)
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy
types can't have their
methods here...
This is just some request from me to cultivate my lazyness.
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group
even when the age has not changed ?
Mike: is this is actually sent to the database ? If it is, maybe we
could avoid this, saving a little network trafic. Although, it has the
benefit to show that .flush() has correctly been triggered, but is
useless for the DB server.
Regards,
--
Alexandre CONRAD
Alexandre CONRAD wrote:
I might not be well waken up, but as I'm looking at your generated SA
logs, it doesn't show that SA updates the row when the data has not
changed. It only seems to update fields that have changed.
Or maybe should I say that I don't see the data beeing updated even
Alexandre CONRAD wrote:
Ok, maybe I got influenced by articles about nested sets beeing better,
as pointed Mike. Now I got you guys advices, I'll look deeper into
adjacency list. I'm glad I've had such feedback on my problem. This
defenitly helps, even more when you just don't know from
Celko's Trees and Hierarchies in SQL for
Smarties.
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
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
Ok, maybe I got influenced by articles about nested sets beeing better,
as pointed Mike. Now I got you guys advices, I'll look deeper into
adjacency list. I'm glad I've had such feedback on my problem. This
defenitly helps, even more when you just don't know from where to start.
Also these
Hello,
I'm realizing that I've been using .list() to query objects. But all the
examples in the docs talk about .all().
What's the difference ? Should I switch to .all() rather than .list() ?
Will list be deprecated in 0.4 ?
Regards,
--
Alexandre CONRAD
Gaetan de Menten wrote:
What's the difference ? Should I switch to .all() rather than .list() ?
Will list be deprecated in 0.4 ?
Exactly. list() is the old way, all() is the 0.4 way.
Thanks Gaetan, I'll clean up my code to be compliant with 0.4.
Regards,
--
Alexandre CONRAD
yes
Glauco wrote:
can someone read me?
Glauco
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
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
correctly. So I just session.flush() all of it. SA does the work for me.
I really don't like #7.
I like what you'll be doing on #13.
It's nice seeing such effort. Thanks Mike for this great toolkit.
Regards,
--
Alexandre CONRAD
Michael Bayer wrote:
hi gang -
seems like I am getting
for that ? :)
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
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
as deprecated ?
Regards,
--
Alexandre CONRAD
On Apr 4, 2007, at 5:40 AM, Alexandre CONRAD wrote:
Glauco wrote:
Alexandre CONRAD ha scritto:
Okay, thanks. Any idea if .filter_by() and other new generative
method
will be available in an assign_mapper object?
Yes..it's available, the final
and will be replaced .join() / .outerjoin().
Regards,
--
Alexandre CONRAD
Michael Bayer wrote:
On Apr 3, 12:39 pm, Alexandre CONRAD [EMAIL PROTECTED] wrote:
And I'd like to find all attachments from one client. But as there's a
weak (secondary) table in between, I can no longer have something like
Glauco wrote:
Alexandre CONRAD ha scritto:
Okay, thanks. Any idea if .filter_by() and other new generative method
will be available in an assign_mapper object?
Yes..it's available, the final object has identical property as a mapper
Well, model.Client.filter_by(sites=siteobj) doesn't
Michael Bayer wrote:
use 'sites':relation(Site, backref=backref('attachments',
order_by=attachment_table.c.name)) for now.
Ok, should I open a ticket for that ?
On Mar 30, 5:50 am, Alexandre CONRAD [EMAIL PROTECTED] wrote:
Hello,
I have a problem with order_by on a many-to-many
attachments, attachments_has_sites
WHERE %s = attachments_has_sites.id_site AND attachments.id =
attachments_has_sites.id_attachment ORDER BY
attachments_has_sites.id_attachment
the ORDER BY is computed against the weak table (secondary)
attachments_has_sites.
Regards,
--
Alexandre CONRAD
, backref=backref(options,
cascade=save-update, delete),
secondary=options_has_sites, cascade=save-update),
},
order_by=option_table.c.name,
)
On Mar 16, 2007, at 10:38 AM, Alexandre CONRAD wrote:
Hello,
I have a many-to-many relation between an option table and a site
: iteration over non-sequence
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
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
://groups.google.fr/group/sqlalchemy/browse_thread/thread/4ba17b080d97aaf5
Regards,
--
Alexandre CONRAD - TLV FRANCE
Research Development
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
()
Should I:
1/ Use the python len() function:
len(client_list)
2/ Use the count() query method. But doesn't it re-query the database ?
Thanks for your advices.
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you
list) to be
assigned for a client, and where every new site hinerits from it's
client's option values as default. Then the site can save it's own
custum values if default values are not satisfying.
Any idea how I could design this ?
Regards,
--
Alexandre CONRAD
%', '%bla%', '%bla%']
Is this the correct way to do it ? Isn't there a way I could give a list
of columns to search in rather than doing it like my example ? Or have a
short way to search for the given pattern in all columns ?
Regards,
--
Alexandre CONRAD
it also contains either the given strings in the constraint.
If validation fails, we could catch the Column's name or a list of all
failed Columns at the Table level.
Regards,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
You received this message because you
,
--
Alexandre CONRAD
--~--~-~--~~~---~--~~
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
('user_id', ForeignKey(users.user_id)),
Here, I don't specify that the FK column is an Integer, because some
clever mechanics would do that for me.
I suppose that this was already thougt before, but I was just wondering...
Regards,
--
Alexandre CONRAD
88 matches
Mail list logo