Hi Mike
Thanks very much for all the feedback, 'expunging the expunges' and setting
expire_on_commit=False worked a treat. Had to add commits for read
operations too, which felt a little awkward, but works nicely.
Nathan
On Monday, 16 May 2022 at 19:19:56 UTC+1 Mike Bayer wrote:
>
tachedInstanceError: Parent instance is not bound to a Session; lazy load operation of attribute
'_lookup' cannot proceed (Background on this error at:
http://sqlalche.me/e/14/bhk3)
```
Thanks
Nathan
On Wednesday, 11 May 2022 at 15:25:11 UTC+1 Mike Bayer wrote:
> the pattern you are using with expunge
Oh, forgot to clarify, if it wasn't obvious... The LookUp is of course in
the session already for the initial object creation, it's only on updating
the created object that this error manifests.
On Wednesday, 11 May 2022 at 11:24:41 UTC+1 Nathan Johnson wrote:
> Hi
>
> I'm attempti
AWarning: Object of type not in session, add operation along
'Dave._lookup' won't proceed
Would really appreciate some insight as to what I'm getting wrong here.
Thanks
Nathan
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example
Thanks for the example, it was exactly what I was looking for.
On Friday, July 21, 2017 at 10:47:16 AM UTC-6, Mike Bayer wrote:
>
> On Fri, Jul 21, 2017 at 11:40 AM, Nathan Mooth <nat.d...@gmail.com
> > wrote:
> > So I have a tree-like data structure that I need to store
So I have a tree-like data structure that I need to store in a way so that
I can see all children or all parents of a query as well as their relative
depth from the query item. In the past I have been using the closure table
method demonstrated in this blog post
ss.post(url, headers=req_headers, data=xml_request, verify=False)
xml_root = _parse_unicode_xml(r.text)
result = [{y.tag: y.text for y in x.iterchildren()} for x in xml_root.
iter('row')]
return result
devices_query = 'SELECT * FROM device'
devices = ccm_execute(devices_query
Thanks Michael,
I really appreciate your help.
On Wednesday, 27 May 2015 14:32:48 UTC+1, Michael Bayer wrote:
On 5/27/15 2:43 AM, Nathan wrote:
Hi,
I'm trying to convert the following query to sqlalchemy:
SELECT cg.id, cg.name cg.status, history.action, history.timestampFROM
Hi,
I'm trying to convert the following query to sqlalchemy:
SELECT cg.id, cg.name cg.status, history.action, history.timestamp
FROM customergame cg
JOIN history ON history.id = (SELECT id FROM history h WHERE cg.id =
h.customergame_id ORDER BY timestamp DESC LIMIT 1)
ORDER BY gamename ASC
Sorry if I’m missing something basic and/or pretty obvious but I don’t know how
to model collections of different types/classes.
For example, let’s say I have these base types/classes:
class Chicken(Base):
__tablename__ = ‘chicken'
id = Column(Integer, primary_key=True)
name =
I’m trying to get a simple join working to a parent table with group_by. I’ve
tried some variations working from the ORM tutorial but keep running into
exceptions or I get multiple queries.
I’m trying to get a single query that results in a collection of Client
instances that’s joined to and
Hi,
I have 3 tables and I'm concerned about possible issues with foreign key
relations and how they might impact my code and its behavior. Maybe there's a
circular reference issue or other concern I should know about with the tables
below?
A player and a song are both created separately and
really appreciate your time.
On Aug 3, 2014, at 5:14 PM, Rich Shepard rshep...@appl-ecosys.com wrote:
On Sun, 3 Aug 2014, nathan wrote:
A player and a song are both created separately and associated with a
client.
class Client(Base):
__tablename__ = 'client'
id = Column(Integer
Hi Mike,
I really wish I could be there and see your presentations. They're usually
recorded right? Just checking and hoping it's recorded... and if so, whoever
records it does a great job. :)
https://us.pycon.org/2014/speaker/profile/455/
Introduction to SQLAlchemy
Hi,
I'm looping writing Media objects with SA, which are just rows in the db that
represent media files. The same Account object/instance is used during each
iteration of the loop and contains the user's username, among other things.
account =
, and it works!
Sorry to have to ask this, but I'm stuck and need to get this working.
Thanks again for all the help!
On Oct 1, 2013, at 1:22 PM, Nathan Mailg nathanma...@gmail.com wrote:
Thanks Mike, that works!
I really appreciate you taking the time to show me how to get this working
.
On Oct 3, 2013, at 2:35 PM, Nathan Mailg nathanma...@gmail.com wrote:
Sorry for this follow-up, but I'm really at a loss as to what to check next…
What should I do if after I insert a new Appl row, the query we've worked
on in this thread is *not* finding it, i.e. it's not being returned
Thanks Mike, that works!
I really appreciate you taking the time to show me how to get this working.
Do you have an amazon wish list or something like that somewhere?
On Sep 30, 2013, at 2:09 PM, Michael Bayer mike...@zzzcomputing.com wrote:
qlast, qfirst = 'a', 'b'
d =
On Sep 20, 2013, at 11:59 AM, Michael Bayer mike...@zzzcomputing.com wrote:
Ok now I'm still not following - in this case, row is a NamedTuple, or a
mapped instance? if its a NamedTuple then you don't have the service of
traversing along object relationships available since the
).\
join(Appl.city).\
join(c, Appl.city).\
order_by(q1.c.lastname, q1.c.firstname)
but that returns:
[…]
File
/Users/nathan/projects/env/lib/python2.7/site-packages/SQLAlchemy-0.8.2-py2.7-macosx-10.8-x86_64.egg/sqlalchemy/orm/mapper.py,
line 1765, in common_parent
they're getting at when I look at
http://www.postgresql.org/docs/9.0/static/sql-select.html#SQL-DISTINCT.
On Sep 18, 2013, at 5:39 PM, Nathan Mailg nathanma...@gmail.com wrote:
Thanks Mike for all the help! I think we're really close.
Unfortunately, the DISTINCT ON (refid) * syntax
On Sep 19, 2013, at 3:07 PM, Michael Bayer mike...@zzzcomputing.com wrote:
On Sep 19, 2013, at 2:46 PM, Nathan Mailg nathanma...@gmail.com wrote:
c = aliased(City)
q2 = s.query(q1).\
join(Appl.city).\
join(c, Appl.city).\
order_by(q1.c.lastname, q1.c.firstname)
why
= aliased(q1, 'd_q_a')
q2 = s.query(q1).order_by(q1.c.lastname, q1.c.firstname)
q2.all()
On Sep 17, 2013, at 6:39 PM, Nathan Mailg nathanma...@gmail.com wrote:
I'm using SA 0.8.2 and trying to port this query that works with PostgreSQL
9.2.4:
WITH distinct_query AS (
SELECT
I'm using SA 0.8.2 and trying to port this query that works with PostgreSQL
9.2.4:
WITH distinct_query AS (
SELECT DISTINCT ON (refid) *
FROM appl
WHERE lastname ILIKE 'Williamson%' AND firstname ILIKE 'd%'
GROUP BY refid, id, lastname, firstname, appldate
I need to add some processing to mapped attributes. For instance,
some extra client side validation, returning attribute values embedded
in markup, etc.
Is there a better way to do this than to change the column definition
(i.e. Column(name, type_, key=_name)) and adding a descriptor to the
Hi,
I've come across a bug (hopefully in my configuration) where
SQLAlchemy will generate an INSERT statement for a table with a SERIAL
primary key which PostgreSQL errors on. I'm running EnterpriseDB's
Postgres Plus 8.4 on openSUSE 11.4 x64, with Python 2.7, SQLAlchemy
0.7.2 and psycopg2 2.4.2.
On Mon, Sep 26, 2011 at 11:05 PM, Michael Bayer
mike...@zzzcomputing.com wrote:
On Sep 26, 2011, at 2:50 AM, Nathan Robertson wrote:
Column('custid', Integer, Sequence('test.customer_custid_seq'),
primary_key=True),
for the Sequence, as with all schema items, you need to specify
On Mon, Sep 26, 2011 at 11:05 PM, Michael Bayer wrote:
On Sep 26, 2011, at 2:50 AM, Nathan Robertson wrote:
Column('custid', Integer, Sequence('test.customer_custid_seq'),
primary_key=True),
for the Sequence, as with all schema items, you need to specify the schema
portion
On Thursday, 26 May 2011 06:42:55 UTC-7, Michael Bayer wrote:
On May 25, 2011, at 10:52 PM, Nathan Wright wrote:
Hi all,
I've run into an issue when mapping a deferred column_property that uses
a custom SQL construct. I get a KeyError: 'default' because there is no
compile function
the
NoSuchColumnError message to not cast key (ie, the select) to a string.
Perhaps the repr could be used instead?
If I'm way off base feel free to let me know, heh, but hopefully this helps!
:)
Cheers,
Nathan
--
You received this message because you are subscribed to the Google Groups
sqlalchemy
Wanted to drop by and mention that I just released the first public
version of Struqtural. In a nutshell, Struqtural tries to make it as
easy as possible to get data into a database, out of a database (as
python objects) and to build some of the more common complex table
arrangements. Struqtural
/speeding-up-inserts-on-mysql/
Thanks for the advice,
Nathan
2009/10/31 Michael Bayer mike...@zzzcomputing.com:
On Oct 30, 2009, at 9:45 AM, Nathan Harmston wrote:
Hi,
I have a script which will process a large amount of data and save
some of those results to the database. This takes
and insert operate? And can I find a way around this?
Nathan
--~--~-~--~~~---~--~~
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
']
[]
With nothing in the species..I can't understand whats going on ...
my only thought is that cll2spe_table isn't being found correctly. Is
there something going wrong. I am using 0.5.3 of SQLAlchemy.
Any help greatly appreciated yet again,
Nathan
PS I continued the old thread as its still regarding
via the t_engine. How can I make it explicitly know this
here? I have tried using different metadata bindings but to no good.
Any pointers/help would be greatly appreciated?
Nathan
--~--~-~--~~~---~--~~
You received this message because you are subscribed
) is
this possible to do aswell?
Many thanks in advance
Nathan
--~--~-~--~~~---~--~~
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
anybody done anything like this
before? Is there a simple way of doing this, maybe at the level of the
mapper?
Many thanks in advance,
Nathan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
tried putting the alias call on the end of the secondary join, which
makes it work perfectly.
Without it calling sentence.genes gives me all of the genes found in
all of the sentences. So my question is really ... why does this work?
What effect does the alias have?
Many thanks in advance,
Nathan
The problem was solved by using a join query and then specifying both
foreign keys and the secondary argument to the relation.
Many thanks,
Nathan
secondary = sentences_table.join(tag_table.join(processed_tags_table,
processed_tags_table.c.tag_id == tag_table.c.tag_id
to finish it off.
Many thanks in advance
Nathan
2009/5/20 Nathan Harmston iwanttobeabad...@googlemail.com:
The problem was solved by using a join query and then specifying both
foreign keys and the secondary argument to the relation.
Many thanks,
Nathan
secondary
)
UnmappedColumnError: No column sentences.sentence_id is configured on
mapper Mapper|Zone|zones
Any pointers greatly appreciated!
Many thanks
Nathan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group
later?
Many thanks in advance, yet again,
Nathan
--~--~-~--~~~---~--~~
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
)
File
/cluster/soft/Linux_2.6_64/lib/python2.5/site-packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/orm/attributes.py,
line 1218, in init
oldinit(instance, *args, **kwargs)
File /cluster/home/nathan/work/workspace/txtmining/Registry.py, line
258, in __init__
self.authors.append(a)
File
of the Species
object with a list of names in an attribute called names. How do I
accomplish this?
Also what do you mean by the correlated criterion of the column_property I
have looked for this and have been unable to find it.
Many thanks in advance,
Nathan
2009/1/26 Michael Bayer mike...@zzzcomputing.com
],
species_table.c.rank=='species').alias('speciesfooalias'))
I get the correct output. I am using SQLAlchemy 0.4.8
I am pretty confused by this. Any help is very much appreciated.
Many thanks in advance,
Nathan
--~--~-~--~~~---~--~~
You received this message because you
(Gb) and I dont want to saturate my
database server with requests and likewise I only have limited memory on my
machines.
Have I missed something simple in the documentation?
My code is below:
Many thanks in advance,
Nathan
document_table = Table('documents', metadata
this column (or use a viewonly=True relation).
Any help greatly appreciated,
Many thanks in advance,
Nathan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email
has has
node1 and 1 node 2.
IS there a pattern in sqlalchemy for doing this sort of thing, I
noticed in the new version of SQLalchemy you can map to sets, but I m
a little clueless where to start.
Any help muchly appreciated.
Nathan
--~--~-~--~~~---~--~~
You
given)
Does anyone know what the problem is? Is it the way I ve programmed this
using metaclasses or is it sqlalchemy and the way in instantiates objects or
even both?
Many Thanks in advance,
Nathan
--~--~-~--~~~---~--~~
You received this message because you
? If not is there any
advice you have to actually use SQLAlchemy in such a way.
I m trying to create an API to my database and dont really want to
have to declare all the tables again.
Many Thanks in advance,
Nathan
--~--~-~--~~~---~--~~
You received this message
What kind of overhead is associated with using the autoload flag?
What kind of overhead would be associated with this over a network? (with a
remote database). Is there a way to dump the structure of a database to a
file and import this as a kind of module?
Thanks
Nathan
51 matches
Mail list logo