, primary_key=True)
I'm not sure I understand the question. I don't think you need the
UniqueConstraint at all - by putting primary_key=True on both
columns, the pairing is guaranteed to be unique anyway.
Simon
--
You received this message because
is fairly
small. If you've come up with a solution that works for you, carry on
:-)
Hope that helps,
Simon
On Mon, Jul 14, 2014 at 12:07 PM, Bao Niu niuba...@gmail.com wrote:
Thank you guys for your replies. These days I spent some time reading the
documentation on session to make sure I
On Fri, Jul 4, 2014 at 6:54 AM, 'Frank Liou' via sqlalchemy
sqlalchemy@googlegroups.com wrote:
Hi Simon
thanks for your answer
but i can't understand what's fetchall() mean
i remove the fetchall() it still work
This is because the ResultProxy returned from conn.execute() is what
I'm not sure I understand your application. Are you saying that you
have Person instances that stay in memory for longer than a single web
request?
Simon
On Sun, Jun 29, 2014 at 11:54 AM, Bao Niu niuba...@gmail.com wrote:
Hi Mike,
Thanks for your reply. In my case, the full_name attribute
. As far as
I'm concerned, hybrid_property is just a convenient mechanism to help
you avoid writing self.FirstName + ' ' + self.LastName everywhere,
even in queries)
Simon
On Mon, Jun 30, 2014 at 11:28 AM, Bao Niu niuba...@gmail.com wrote:
Hi Simon,
Sorry for the poor explanation in my previous post
, such as the JSON example in the docs:
http://docs.sqlalchemy.org/en/rel_0_9/core/types.html#marshal-json-strings
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send
to the person instance. You would use it like:
name_query = p.names_collection.filter(Names.name.startswith('B'))
This usually only makes sense for very large collections, since you
can't really eager-load a dynamic relationship.
Hope that helps,
Simon
--
You received this message because you
://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/declarative.html#accessing-the-metadata
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr
In that case, could you send a stripped-down single-file test case
with just those 2 classes that shows the problem?
Thanks,
Simon
On Thu, Jun 12, 2014 at 5:13 PM, ty...@beanfield.com wrote:
I have tried calling relationship without foreign_keys or primaryjoin, in
which case I get an error
='all, delete-orphan'))
if __name__ == '__main__':
engine = create_engine('sqlite://', echo='debug')
Session = sessionmaker(bind=engine)
Base.metadata.create_all(bind=engine)
On Thu, Jun 12, 2014 at 5:19 PM, Simon King si...@simonking.org.uk wrote:
In that case, could you send
):
setattr(cls, f.__name__, f)
return patcher
@monkeypatch(some_model.Alice)
def myfunc(self):
do_nothing_sql_related_here()
(This is pretty nasty really, but depending on your requirements it
might be the easiest way to make it work)
Hope that helps,
Simon
--
You received
(trigger).execute(bind=engine)
for x in 'UPDATE', 'INSERT', 'DELETE':
event.listen(Foo.__table__, after_create, make_handler(x, engine))
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group
foreign_keys=ON)
cursor.close()
def enable_sqlite_foreign_keys():
sqlalchemy.event.listen(sqlalchemy.engine.Engine, 'connect',
_set_sqlite_pragma)
...and then call the enable_sqlite_foreign_keys function somewhere in
your application setup code.
Hope that helps,
Simon
--
You received
without getting this error?
I've never used oracle with sqlalchemy before, but looking at the
bottom of the stack trace, is it possible that you have declared your
column as some sort of BLOB type but it is actually a simpler data
type in the database?
Hope that helps,
Simon
--
You received
,
relationship_type=marriage))
martha.relationships
[]
session.commit()
[Relationship Washington, Martha Washington, George (Marriage)]
What do your mappings look like for the classes in question?
Simon
--
You received this message because you are subscribed to the Google Groups
= q.filter(tblKey2goGdataLocation.id == 123)
result = q.first()
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr
You can also use sqlalchemy.literal, which returns an object that you
can treat like a column:
sqlalchemy.literal('string').like('whatever')
You may also be interested in the 'startswith' shortcut, which calls
.like under the hood
sqlalchemy.literal('string').startswith(yourcolumn)
Simon
here? It opens you up to bugs and possibly sql
injection attacks if you don't quote your strings properly. For
example, what happens if tmm_id contains a single quote?
Cheers,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from
example to work because you are attaching the freshly
loaded child instance to a parent which is no longer associated with a
session. What happens in your test if you reload the parent instance
first?
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy
(model.User)
.filter_by(id=1)
.options(joinedload('foo'),
joinedload('foo.bar'))
.first())
This will join to the User table and fetch all its columns - I don't know if
there's an easy way to avoid that.
Simon
--
You received this message because you
= session.query(cls)
condition = []
for col, val in zip(primary_key, identity):
condition.append(col == val)
query = query.filter(sa.and_(*condition))
return query
u = session.query(User).get(1)
get_query(u).options(joinedload_all('foo.bar')).first()
Simon
--
You received
'
__table_args__ = {'autoload':True, 'schema':'sdssphoto'}
PhotoObj.children = relationship(PhotoObj, backref=backref('parent',
remote_side=[PhotoObj.pk]))
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group
pass the appropriate filesystem path
to SQLAlchemy. Examples are at
http://docs.sqlalchemy.org/en/rel_0_9/dialects/sqlite.html#connect-strings
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group
= Appointment(appointment_user_relation=user)
# Association proxy does this:
appointment.meeting_appointment_relation = meeting
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop
I would say that the extension is intended to replace SqlSoup in the
future, but may not be ready for that quite yet.
Simon
On Tue, Mar 25, 2014 at 12:39 AM, Bao Niu niuba...@gmail.com wrote:
Compare to SQLsoup, is this extension more recommended?
On Mon, Mar 24, 2014 at 3:32 AM, Simon King
after a commit or abort)
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group
., leaving out the red part?
Will this feature likely be included in future versions, say, sqlalchemy
1.0?
You might be interested in the experimental automap extension:
http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/automap.html
Hope that helps,
Simon
--
You received this message
You'd probably have to examine the delete_context.query object to see
which class is being deleted, and figuring out exactly which rows have
been deleted might also be a problem (since the filter conditions
passed to the query could be arbitrarily complicated).
Simon
--
You received this message
to switch. And you can trust that the Session
will use the bindings established on the metadata, if it is not
explicitly bound itself.
Simon
On Thu, Mar 13, 2014 at 7:48 AM, Bao Niu niuba...@gmail.com wrote:
Hi Simon,
I've got a follow-up question regarding the best practice. You seem to
favour
on a per-session basis which engine you want to use (for
example if you had different engines for read and write access).
Hope that helps,
Simon
On Wed, Mar 12, 2014 at 7:25 AM, Bao Niu niuba...@gmail.com wrote:
Ok, let me try rephrasing my question.
Is binding an engine/connection simultaneously
On Mon, Mar 3, 2014 at 7:55 AM, Chris Withers ch...@simplistix.co.uk wrote:
Hi Simon,
On 26/02/2014 13:18, Simon King wrote:
I don't know exactly what your needs are, but here's the example from the
docs:
engine1 = create_engine('postgresql://db1')
engine2 = create_engine
/PreFilteredQuery
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy
://docs.sqlalchemy.org/en/rel_0_9/orm/mapper_config.html#mapping-a-class-against-arbitrary-selects
The docs discourage mapping to a select because of the complexity of
the resulting queries, but in your case perhaps those queries are
exactly what is required.
Hope that helps,
Simon
On Thu, Feb 27, 2014 at 1:06
() method:
http://docs.sqlalchemy.org/en/rel_0_9/orm/session.html#sqlalchemy.orm.session.Session.get_bind
http://docs.sqlalchemy.org/en/rel_0_9/orm/session.html#sqlalchemy.orm.session.Session.params.binds
Would that work in your situation?
Simon
On Wed, Feb 26, 2014 at 12:50 PM, Chris Withers ch
, and I'm always glad when I see a question I can actually
answer ;-)
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com
:
status_args = {trans_status: 1}
status = Status(**status_args)
new_trans = Transaction(date=cur_date, status=status)
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from
I've never used two-phase commit, but can you get away with just a
single session, like the example at:
http://docs.sqlalchemy.org/en/rel_0_9/orm/session.html#enabling-two-phase-commit
Simon
On Tue, Feb 25, 2014 at 6:07 PM, Chris Withers ch...@simplistix.co.uk wrote:
No takers
])
sc.name = 'sc1modified2'
sc.somebool = True
session.commit()
checkhistory([False, None])
if __name__ == '__main__':
test()
Thanks in advance for any help,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe
. This is more complicated given that
you want to compare related objects as well, but perhaps it would be
fine if you were to query the primary object (eg. User in your
example above) and then allow SA to load the associated Addresses
automatically.
Hope that helps,
Simon
--
You received this message
you have expired
objects whose state is newer than the database?
Cheers,
Simon
On Mon, Feb 24, 2014 at 12:06 PM, Bao Niu niuba...@gmail.com wrote:
Sorry for my slowness, but I still have a minor problem understanding
expired object. Why does it always assume that the database carries the
most
On Mon, Feb 24, 2014 at 12:01 PM, Simon King si...@simonking.org.uk wrote:
Hi,
I'm using the Versioned class from the examples, and I noticed that
when I set a Boolean column to None (NULL in the db), the eventual
history row corresponding to that change gets a 0 rather than a NULL
it might be more complicated, but I don't use Python 3 so
I can't really help you.)
If you are using Python 2 and the strings don't compare equal, perhaps
you have an incorrect encoding defined somewhere?
Simon
On Mon, Feb 24, 2014 at 12:59 PM, marcin.rafal.adam...@gmail.com wrote:
I've tried
would only be used if I
never set the attribute at all. Does this mean that there's no way
through the ORM to insert a new row with NULLs for columns that have
been assigned a default value? (Just an idle question, not something I
need).
Thanks again,
Simon
On Mon, Feb 24, 2014 at 5:31 PM, Michael
-of-the-mapped-class
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email
you can use to control how the pool works. See the docs at
http://docs.sqlalchemy.org/en/rel_0_9/core/pooling.html
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from
I've not done much with reflection, but perhaps you could use the
column_reflect event:
http://docs.sqlalchemy.org/en/rel_0_8/core/events.html#sqlalchemy.events.DDLEvents.column_reflect
Simon
On Tue, Feb 4, 2014 at 11:28 AM, Erich Blume blume.er...@gmail.com wrote:
Thanks Simon,
Do you
, and I had to
set uselist=False on the a.b backref.
If you get different results, what version of SA are you using?
Simon
On 28 Jan 2014, at 17:45, Michael Nachtigal
michael.nachti...@catalinamarketing.com wrote:
Simon,
Thanks very much for your detailed reply. Here's your example tailored
Oh, yes, of course, I forgot that foreign keys aren’t immediately updated when
you manipulate a relationship. Your suggested change sounds exactly right.
Thanks again,
Simon
On 25 Jan 2014, at 02:30, Michael Bayer mike...@zzzcomputing.com wrote:
well since create_version() is called
On Thu, Jan 23, 2014 at 7:46 PM, Michael Bayer mike...@zzzcomputing.com wrote:
On Jan 23, 2014, at 2:07 PM, Simon King si...@simonking.org.uk wrote:
That's fantastic, thanks so much. I feel bad that my silly use case
has caused so much work for you and grown the docs even more (perhaps
you
:
if p.foreign_keys:
obj_changed = True
break
if obj_changed is True:
break
I can't figure out the circumstances when this should be necessary -
can someone explain it to me?
Thanks a lot,
Simon
On Fri, Jan 24, 2014 at 4:22 PM, Simon King si...@simonking.org.uk wrote:
Hi again,
While testing the complicated relationship from the other thread, I
noticed that I was generating a lot of queries that I couldn't
immediately explain. After a bit of digging, it turned out that it was
due
===
count = 3
len(results) = 1
1. __main__.A object at 0x10b8bf9d0
The second and fourth tests are the same as the first and third with a
joinedload(‘cs’) added. In both cases, the results remain the same.
Cheers,
Simon
On 24 Jan 2014, at 22:36, Michael Nachtigal
michael.nachti
On Thu, Jan 23, 2014 at 1:45 AM, Michael Bayer mike...@zzzcomputing.com wrote:
On Jan 22, 2014, at 7:17 PM, Simon King si...@simonking.org.uk wrote:
I read the bit in the docs about non-primary mappers but was scared
off by the almost never needed warnings. Actually, for the purposes
I'm
, session.query(Class), session.add,
session.commit .etc
Yes, absolutely. SQLAlchemy doesn't care how the database was created.
You should be able to use all the normal operations on a database
created by some other means.
Hope that helps,
Simon
--
You received this message because you are subscribed
() or remote().
Thanks for any advice,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send
(),
Acceptance.datetime) = 365
If this relationship finds a matching row, the user has accepted the
terms in the last year. But if no row matches, the user must
re-accept.
I'll work up the test script tomorrow to clarify.
Thanks,
Simon
--
You received this message because you are subscribed to the Google
,
Simon
On 22 Jan 2014, at 23:35, Ni Wesley nisp...@gmail.com wrote:
I mean sqlalchemy ORM, that is, use python class mapping to database table.
I know sqlalchemy core expression does work, this guy doesn't care how
database is created.
Wesley
2014年1月22日 下午7:04于 Simon King si...@simonking.org.uk写道
On 22 Jan 2014, at 23:45, Michael Bayer mike...@zzzcomputing.com wrote:
On Jan 22, 2014, at 11:54 AM, Simon King si...@simonking.org.uk wrote:
Hi all,
I've been having a little trouble configuring a relationship between 2
mapped classes where the join condition pulls in another 2 tables
in using
load_only instead:
http://docs.sqlalchemy.org/en/rel_0_9/orm/mapper_config.html#load-only-cols
which is part of a bigger topic about deferred column loading:
http://docs.sqlalchemy.org/en/rel_0_9/orm/mapper_config.html#deferred-column-loading
Hope that helps,
Simon
--
You received
(s)
for row in result:
print row
Applying filter conditions to a Select object is described at
http://docs.sqlalchemy.org/en/rel_0_9/core/tutorial.html#selecting.
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group
the examples at
http://docs.sqlalchemy.org/en/rel_0_9/core/tutorial.html#using-joins
Hope that helps,
Simon
On Fri, Nov 29, 2013 at 2:46 PM, Glenn Wilkinson
glenn.wilkin...@gmail.com wrote:
Hi Simon,
Thanks for the reply.
I've been using sqlalchemy fine with other queries not using a join
)
Are there any cool tricks I don't know?
Thanks
How about:
values = {‘XML Schema Version’: None}
db.table.insert(**values)
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving
bind parameters work,
each id needs a separate parameter.
Is it important that you get the results all in one go? Could you try
processing the ids in smaller batches, perhaps 100 or so at a time?
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group
? The docstring says that it creates a sqlalchemy.schema.Table
object, but I read that as just an implementation detail - I don't
think a new table should end up in the database.
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from
far. How you proceed from here
really depends on how you application is going to use the data in this
database.
Cheers,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send
: these attributes aren't changed until you call
session.flush()
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post
with the data.
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email
than n
seconds.
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email
I'm not sure that will work on it's own, will it? When used in a class
context (Plan.calculated_date), you will end up calling the date
function with 3 SQLAlchemy column objects, which won't work.
At a minimum, you'd need this:
class Plan(Base):
@hybrid_property
def
question, but have you installed the
psycopg2 package (https://pypi.python.org/pypi/psycopg2)?
SQLAlchemy doesn't include the low-level database drivers - you have
to install the appropriate driver for the database you are using.
Hope that helps,
Simon
--
You received this message because you
loading of data, you could look at the examples at
http://docs.sqlalchemy.org/en/rel_0_7/core/tutorial.html#executing-multiple-statements
Simon
On Mon, Sep 23, 2013 at 6:54 AM, monosij.for...@gmail.com wrote:
Hi Simon -
Great! The executescript from sqlite worked great. I had not seen that. I
will be the same.
I think you need to find a way to split your scripts up into individual
statements that you can run one at a time.
Hope that helps,
Simon
On 21 Sep 2013, at 16:14, monosij.for...@gmail.com wrote:
Hi Michael and Simon - Thank you for your responses and help. Sorry I should
() so that your script aborts
after an exception.
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group
WHERE name LIKE '%Mohsen%'
AND phonenumber LIKE '%1%'
Is that the sort of SQL that you are hoping to see, or do you need something
different?
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving
on
which connections. When the error occurs, look at all the SQL sent on that
connection and perhaps you will see what is causing the problem.
On 6 Sep 2013, at 21:42, herzaso herz...@gmail.com wrote:
Hi Simon,
I've removed the scoped_session altogether but the problem still persists
at
http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html#sqlalchemy.orm.scoping.scoped_session),
or you could get rid of scoped sessions altogether, and instead create
a session at the beginning of a request and pass it to your handler
functions (or attach it to the Request object).
Simon
On Thu
(Person.name).filter(Person.age 100).first()
You can also defer certain columns so that they will be loaded lazily:
http://docs.sqlalchemy.org/en/rel_0_8/orm/mapper_config.html#deferred-column-loading
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google
not quite the same as your error message. What
version of SQLAlchemy are you using? (The above was from 0.8.2)
Simon
On Tue, Sep 3, 2013 at 10:15 AM, lars van gemerden l...@rational-it.com wrote:
I am getting that same error (not the original one). For the moment i've
solved the problem in a different
with this issue... not only do I feel helpless, I don't
have any clue on how to get around it ...
What if I make the change without the session? Would the session pick up
the changes on its first query?
On Monday, September 2, 2013 3:58:02 PM UTC+3, Simon King wrote:
I'm no expert on isolation
logged-in
users) what are the odds that the same user will get the same error 10
times?
On 3 Sep, 2013 3:05 PM, Simon King si...@simonking.org.uk wrote:
Race conditions can happen at any time, not just when the system is
under heavy load. You only need 2 requests to arrive at approximately
-
From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On
Behalf Of Simon King
Sent: Tuesday, September 03, 2013 3:28 PM
To: sqlalchemy@googlegroups.com
Subject: Re: [sqlalchemy] Occasional IntegrityError when identifying model
not by its ID
OK, I agree that doesn't sound like
other constraint in the database?
Simon
On Mon, Sep 2, 2013 at 8:45 AM, herzaso herz...@gmail.com wrote:
I'm afraid it didn't solve my problem.
Here is my updated method:
@classmethod
def get(cls, bar=None, baz=None, qux=None, **kwargs):
query = session.query(cls
has inserted a
matching row in the meantime.
Simon
On Mon, Sep 2, 2013 at 12:54 PM, herzaso herz...@gmail.com wrote:
I'm not sure what to make of the results:
On the first connection, I ran BEGIN and INSERT and both were successful,
but when I tried the INSERT statement on the second connection
have it set as REPEATABLE READ.
However, I don't use transactions in sqlalchemy
On Monday, September 2, 2013 3:08:58 PM UTC+3, Simon King wrote:
Do you know what transaction isolation level you are running at? The
default apparently is REPEATABLE READ:
http://dev.mysql.com/doc/refman/5.6/en
, dealing with concurrent operations is hard, and SQLAlchemy
isn't going to magically make it any easier I'm afraid.
Simon
On Mon, Sep 2, 2013 at 1:40 PM, herzaso herz...@gmail.com wrote:
I'm sorry, it was a misunderstanding on my part regarding the transactions.
So what are you saying? that I should
it a try with a session.close to see if it helps (although I
think I had complaints from users running the same API several times - and
each time, at the end of my REST APIs I run session.close)
On Monday, September 2, 2013 3:58:02 PM UTC+3, Simon King wrote:
I'm no expert on isolation levels - I
violate that assumption (eg. by loading one instance of
person from the database, then creating another instance and setting
its primary key), you will get errors like this.
Does that sound plausible?
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy
in diagnosing the problem.
Simon
On 2 Sep 2013, at 18:56, Lars van Gemerden l...@rational-it.com wrote:
Well, from the message yes, but i am not setting any primary keys manually,
so where could the second instance come from?
CL
Lars van Gemerden
l...@rational
is to use session.merge to create a copy
of the object, attached to the new session. If you change the last few lines of
the script above to:
sess2 = Session()
merged = sess2.merge(person)
sess2.add(merged)
...it works fine.
Hope that helps,
Simon
On 2 Sep 2013, at 19:58, lars van
it from your mapped class via the __table__
attribute, but most of the time you don't need it.
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
(Seller.name == 'golrang').delete()
If you want to use the underlying sellers Table object, it would look something
like this:
delete_statement = sellers.delete().where(sellers.c.name == 'golrang')
session.execute(delete_statement)
Hope that helps,
Simon
PS. note the convention that Table instances
,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com
, because the foreign
keys will be inserted with their old values rather than the new ones.
Fixing that would be much more complicated.
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop
. In answer to your
first question,
http://dev.mysql.com/doc/refman/5.5/en/metadata-locking.html suggests
that non-transactional tables can also be involved in metadata locks.
I'm afraid I can't help with the rest.
Simon
--
You received this message because you are subscribed to the Google Groups
On Thu, Aug 29, 2013 at 5:20 PM, Simon King si...@simonking.org.uk wrote:
On Thu, Aug 29, 2013 at 4:48 PM, diverman pa...@schon.cz wrote:
Hi,
we observed deadlock-like problem on our multi-component system with mysql
database.
Our setup:
1) MySQL server 5.5 with many MyISAM tables
On Thu, Aug 29, 2013 at 6:01 PM, diverman pa...@schon.cz wrote:
Dne čtvrtek, 29. srpna 2013 18:23:12 UTC+2 Simon King napsal(a):
On Thu, Aug 29, 2013 at 5:20 PM, Simon King si...@simonking.org.uk
wrote:
On Thu, Aug 29, 2013 at 4:48 PM, diverman pa...@schon.cz wrote:
Hi,
we observed
at the UniqueObject recipe in the wiki:
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject
Hope that helps,
Simon
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
, addRecord,
createEngine, createSession and so on.
SellersTable is class name of sellers table.
Where's Problem?
It sounds like you are trying to delete an entry which you've never
stored in the database. Where are you getting your ddd object from?
Simon
--
You received this message because
On Tue, Aug 27, 2013 at 2:31 PM, herzaso herz...@gmail.com wrote:
On Tuesday, August 27, 2013 3:55:50 PM UTC+3, Simon King wrote:
On Tue, Aug 27, 2013 at 1:40 PM, herzaso her...@gmail.com wrote:
I have a model with an ID column set as the primary key, though i'd like
to
be able
. If you want to avoid the SELECT, you can use the
Query.delete() method, something like this:
session.query(SellersTable).filter_by(name_type=1).delete()
http://docs.sqlalchemy.org/en/rel_0_8/orm/query.html#sqlalchemy.orm.query.Query.delete
Hope that helps,
Simon
On 27 Aug 2013, at 18:28
501 - 600 of 921 matches
Mail list logo