Hi!
Is it possible to force query to automatically expire instance's lazy
attributes? And I mean instances that were queried and accessed before
the second query?
Example:
mapper(MyObject, my_table, properties={
myattr: relation(ChildObject)
})
following code will lead in only 3 SELECTs
this is what I'm looking for but it doesn't work in 0.4.8. 0.5 is fine?
Michael Bayer napsal(a):
do you perhaps mean to say, query(Sortment).outerjoin((Translation,
and_(Sortiment.id==Translation.sortiment_id,
Translation.langauge=='en'))) ?
On Jan 7, 2009, at 4:04 PM, ml wrote
Hi!
I have 2 tables:
sortiment(id, ...) translations(id, id_sortiment, language, text)
The query
query(Sortiment).outerjoin(Sortiment.translations).filter(Translation.language=en)
will never return sortiment item with missing en translation because
the filter (useless outerjoin). I need
That is a solution but it is not very efficient. It involves a
sequential scanning of the result of the join inside the database.
Michael Bayer napsal(a):
On Jan 7, 2009, at 11:49 AM, ml wrote:
Hi!
I have 2 tables:
sortiment(id, ...) translations(id, id_sortiment, language
Of ml
Sent: Wednesday, August 27, 2008 2:09 AM
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: error when running query.count()
Hi!
There are more than 1 mapper to an object. Send your mappers configuration.
David
mkhan napsal(a):
Hi, I am trying get a count for a query
Hi!
There are more than 1 mapper to an object. Send your mappers configuration.
David
mkhan napsal(a):
Hi, I am trying get a count for a query but it errors out with
following message:
Page handler: bound method Root.index of harvest.controllers.Root
object at 0x018444B0
Traceback
thats a bug which was fixed post 0.4.7p1. Its in trunk and is for
0.4.8.
Great!
And back to the mapper properties. As I found it always do a
polymorphic_fetch=select-like query when dealing with mapper properties
referencing a polymorphic base. This is not very efficient. I would
prefer an
Hi!
How can I disable a polymorphic load for a single query? I found a hint
in http://markmail.org/message/2kwbm377j3pdvvqb but I can't find more.
Thanks for any advice.
David
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
, 2008, at 10:35 AM, ml wrote:
Hi!
How can I disable a polymorphic load for a single query? I found a
hint
in http://markmail.org/message/2kwbm377j3pdvvqb but I can't find more.
Thanks for any advice.
David
--~--~-~--~~~---~--~~
You received
, at 11:24 AM, ml wrote:
This is not working:
Setup:
base = Table(base, metadata,
Column(id, Integer, primary_key=True),
Column(kind, Integer),
)
derived = Table(derived, metadata,
Column(id, Integer
.
if you're depending heavily on inheritance I strongly recommend
looking at 0.5, this is one area where a significant amount of work
has been done.
On Aug 25, 2008, at 11:24 AM, ml wrote:
This is not working:
Setup
inherit_condition=derived.c.id==base.c.id
or
inherit_condition=base.c.id==derived.c.id
But why? Is my inherit_condition incorrect at all?
The example code is attached.
Michael Bayer napsal(a):
On Aug 25, 2008, at 1:05 PM, ml wrote:
One more thing :-)
Now I have polymorphic_fetch=deferred
Hi!
Or something like
s.query(A).filter(not_(A.column.in_(select(table_b.c.column))
David
Empty napsal(a):
Hello Felix,
No I want to get all items from table A where no matching item in table B
exists. I'm aware that this would be very easy if table A stores the
foreign key.
Hi!
Let's have a typical schema: Company - Employee
How can I add a scalar column (in a query or a mapper) to the Company
containing the employees count? E.g. query(Company).all() will return
list of Company instances and each will have an extra property with
emloyees count. But I don't want
Hi!
How can I invert the in_ operator? I need a select like:
... name NOT IN ('alice', 'bob')...
...filter(not User.name.in_('alice', 'bob'))... is not working.
Thanks for advices.
David
--~--~-~--~~~---~--~~
You received this message because you are
Hi!
I have following situation: I have 3 tables which stand as a base for
other stuff:
table_virtual_categories = Table(virtual_categories, meta,
Column(id, Integer, primary_key = True),
Column(id_parent, Integer, ForeignKey(virtual_categories.id)),
Column(visible, Boolean,
that's it! great, thanks!
Michael Bayer napsal(a):
On Jun 10, 2008, at 8:34 AM, ml wrote:
So as you can see the table articles is quite redundant because it
has
only the primary key column but I didn't find any other way to select
articles directly from the table virtual_items
Hi!
Just put somewhere an explicit import sqlite. It should be enough.
David
pdamoc napsal(a):
Hello,
I've tried packing an app I've made with py2exe and run into
trouble...
first it was an EGG issue, I've fixed that installing everything as a
directory
next came the sqlite issue... I
That's it, thanks!
Michael Bayer napsal(a):
On May 4, 2007, at 9:17 AM, ml wrote:
Hi!
I have a few tables with non-integer primary keys. Following raises an
exception:
meta = MetaData(name=somemeta)
themes = table(themes, meta,
Column(title, Unicode(30), primary_key=True
Michael Bayer napsal(a):
On May 1, 2007, at 4:42 AM, ml wrote:
I want to get recipes which belongs to a particular category and
having
a particular flag. So I need both joins recipe-category and recipe-
flag.
ah. in that case you dont want query.join(x).join(y), you want
I want to get recipes which belongs to a particular category and having
a particular flag. So I need both joins recipe-category and recipe-flag.
Michael Bayer napsal(a):
On Apr 30, 2007, at 8:40 AM, ml wrote:
Hi!
I have 2 relations:
- recipes-categories (M:N)
- recipes-flags (M:N
Excellent!
Michael Bayer napsal(a):
0.3.7 is out and has a huge number of improvements and fixes. some
of the highlights:
- server side cursor support for Postgres
- much improved auto-reconnect support
- informix support
- long identifier name support
- support for unicode
Hi!
I have 2 relations:
- recipes-categories (M:N)
- recipes-flags (M:N)
I'd like to get something like:
SELECT recipes.title FROM recipes
JOIN _recipes_ctgs_recipes
ON _recipes_ctgs_recipes.id_recipe = recipes.id
JOIN recipes_ctgs
ON
Thanks!
How stable is this revision? Is it suited for production?
Michael Bayer napsal(a):
OK r2579
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
2) the number of connections to the db growing ... is implemented well
the MetaData() class ? I'm using postgresql schema's and I want to
mantain a single connection for every db user.
Hi!
I had the same problem because I was calling create_engine in every page
request (apache +
e.g. order_by = [desc(table1.mycol)]
Disrupt07 napsal(a):
In my table I have a column with type Boolean. When using order_by on
this column I am getting the results as follows:
False
False
True
True
True
...
True
I want them the other way round (the True first, then the False).
How can I select user's addresses when I know only his id? And I don't
want to select the user first.
session.query(Address).join(user).select(User.c.id==the user id)
I was afraid of that :-) I hoped it can go in a cleaner way like
join(Address.c.user) but giving the property as a
Hi!
Lets have:
##
users_table = Table(users, metadata,
Column(id, Integer, primary_key=True),
Column(user_name, String(16))
)
addresses_table = Table(addresses, metadata,
Column(id, Integer, primary_key=True),
Column(id_user, Integer, ForeignKey(users.id)),
See attachment. Tested against 0.3.6.
Michael Bayer napsal(a):
On Apr 12, 2007, at 12:53 PM, ml wrote:
I tried s.query(Address).select_by(user=u) as I found similar in the
documentation
(http://www.sqlalchemy.org/docs/
datamapping.html#datamapping_selectrelations_relselectby)
but SA
I'm such a moron. I downloaded the SA source into a sqlalchemy3
directory but the SA expects it in a sqlalchemy package so it was
internaly loading the old 0.2.8 Ubuntu version.
Sorry! :-)
Michael Bayer napsal(a):
On Apr 12, 2007, at 12:53 PM, ml wrote:
I tried s.query(Address).select_by
Hi!
I found a quite strange behavior. Reproduction is simple.
Setup:
selfref=Table(selfref, metadata,
Column(id,Integer, primary_key=True),
Column(id_par,Integer, ForeignKey(selfref.id))
)
class SelfRef(object):pass
mapper(SelfRef, selfref, properties={
Hi!
I want meta.create_all() to generate and print the SQL only and don't
query the DB. Is there any way?
Thanks for advices.
David
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to
Hi!
Just for curiosity: why sqlalchemy is using constants in strings?
E.g.:
cascade = all, delete-orphan
Why not something like:
cascade = ALL | DELETE_ORPHAN
I'm asking because I realized that when I make a mistake in the string
the sqlalchemy doesn't report anything and my program crashes
Hi!
I had similar problem with module postgres. py2exe didn't automaticaly
include the module so I simply put import
sqlalchemy.databases.postgres into the main script. Perhaps you should
try something like this with the logging.
DS
Karlo Lozovina píše v Út 19. 12. 2006 v 04:01 +:
Hi
Hi!
Can I force SA (0.2.8) to ignore the sqlalchemy.exceptions.SQLError:
(ProgrammingError) value too long for type character varying... and
silently truncate the inserted data?
Thank you!
David
--~--~-~--~~~---~--~~
You received this message because you are
This is a duplicate mail (due to a recent SMTP problems). Don't reply.
DS
ml píše v Po 11. 12. 2006 v 23:13 +0100:
Hi!
I have a little questions about how does the SA work:
Example:
I borrowed a model from SA documentation example User/Address. My mapper
is
mapper(Address
Hi!
I have a little questions about how does the SA work:
Example:
I borrowed a model from SA documentation example User/Address. My mapper
is
mapper(Address, addresses_table)
mapper(User, users_table, properties = {
'addresses' : relation(Address, cascade=all, delete-orphan)
Client application doesn't mean web application and SqlAlchemy would
be a too big hammer for SQL console (in my opinion). Well it will be an
information system written with wxPython running on multiple computers.
I don't want users to see information for direct access to the database.
I was
Jonathan Ellis píše v Pá 08. 12. 2006 v 11:05 -0700:
On 12/7/06, ml [EMAIL PROTECTED] wrote:
I want to have a client application accessing a remote Postgres database
but I don't want to distribute the user/password to the DB. I want
clients to authenticate against some other table
Jonathan Ellis píše v Pá 08. 12. 2006 v 15:40 -0700:
On 12/8/06, ml [EMAIL PROTECTED] wrote:
Jonathan Ellis píše v Pá 08. 12. 2006 v 11:05 -0700:
On 12/7/06, ml [EMAIL PROTECTED] wrote:
I want to have a client application accessing a remote Postgres database
but I don't want
40 matches
Mail list logo