this is...another test! imagine that
On Wednesday, January 4, 2023 at 7:27:10 PM UTC-5 Mike Bayer wrote:
> test
>
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
E
the net-change to "user1.teams" is likely sending it through the
"after_update" event but no net SQL is being emitted if no actual columns
have changed on user1.
you would need to adjust the logic in your application to more specifically
check for those conditions in which you want to act upon
the async aspect here is not that important, for Declarative + reflection
you likely should look at DeferredReflection:
https://docs.sqlalchemy.org/en/14/orm/declarative_tables.html#using-deferredreflection
for async, where it has in the example:
Reflected.prepare(engine)
you would instead say
is truncate happening in some other process? does it speed up once you
kill the initial python process? does this truncate take time with other
kinds of INSERT statements? is the table very large? overall you need
to perform more observations here as to what conditions cause this
"trunc
using logging is the most direct way, however if you want to
programmatically intercept all SQL you can use before_cursor_execute:
https://docs.sqlalchemy.org/en/14/core/events.html#sqlalchemy.events.ConnectionEvents.before_cursor_execute
On Thursday, December 8, 2022 at 9:31:56 AM UTC-5 yahme..
we don't support the SQL standard MERGE directly right now but you can
always emit this statement using text().
We support only the MySQL / PostgreSQL / SQlite driver specific INSERT..ON
CONFLICT kinds of statements directly right now.
On Sunday, December 11, 2022 at 11:34:43 AM UTC-5 mkmo...
yeah you can use defaultload.load_only
defaultload(ModelA.model_b).load_only(ModelB.only_field)
On Wednesday, January 4, 2023 at 3:15:02 AM UTC-5 to...@revenuecat.com
wrote:
> Hi,
>
> This might be a strange question, but I tried to find this in the
> documentation to no avail.
>
> Is it po
On Sunday, February 14, 2016 at 4:12:36 PM UTC-5, Brian Cherinka wrote:
>
> Hi,
>
> I'm trying to use automap a schema, and let it generate all classes and
> relationships between my tables. It seems to work well for all
> relationships except for one-to-one
> I know to set a one-to-one rela
order_by, you spelled it wrong.
> On Feb 14, 2016, at 3:53 AM, wrote:
>
> Hi Mike
>
>> On 2016-02-13 14:30 Mike Bayer wrote:
>> you can order by secondary, just add it in:
>>
>> authors = relationship("Person", secondary=ReferenceAuthor,
>> order_by=ReferenceAuthor.c.Index)
>
> Are you sur
Two options - either use back_populates format (search the docs) to set up
bidirectional relationships, or call configure_mappers() after the model
classes have been defined.
> On Jan 11, 2016, at 3:47 PM, Sam Raker wrote:
>
> Using SQLAlchemy 1.0.9's declarative extension, I've got a many-
Sent from my iPhone
> On Jan 11, 2016, at 3:47 PM, Sam Raker wrote:
>
> Using SQLAlchemy 1.0.9's declarative extension, I've got a many-to-one
> relationship defined thusly:
>
> class Article(Base):
>...
>publisher_id = schema.Column(sqltypes.Integer,
> schema.ForeignKey('publishers
Look into the type_coerce() function for that.
> On Nov 10, 2015, at 5:46 PM, Uri Okrent wrote:
>
> Seems like a simple thing to do but I can't seem to find an example. Say I
> have a simple column_property like the example in the docs:
>
> fullname = column_property(firstname + " " + lastnam
Sent from my iPhone
> On Nov 10, 2015, at 5:46 PM, Uri Okrent wrote:
>
> Seems like a simple thing to do but I can't seem to find an example. Say I
> have a simple column_property like the example in the docs:
>
> fullname = column_property(firstname + " " + lastname)
>
>
> and I want to
Thanks very much for this post, Paul!
Sent from my iPhone
> On Sep 4, 2015, at 3:43 PM, Paul Johnston wrote:
>
> Hi guys,
>
> I decided to express my love of SQLAlchemy through a blog post:
> http://pajhome.org.uk/blog/10_reasons_to_love_sqlalchemy.html
>
> Enjoy,
>
> Paul
> --
> You receiv
> On Jun 20, 2015, at 10:40 AM, (by way of c.bu...@posteo.jp)
> wrote:
>
> I read about the Serializer Extension and ask myself if it is a good
> solution for my problem.
Haven't even read the rest of your email yet, and the answer is no. The
serializer works really badly.
>
> Current
> On Apr 20, 2015, at 12:56 PM, Guido Winkelmann
> wrote:
>
>> On Monday 20 April 2015 11:23:06 Mike Bayer wrote:
>> On 4/20/15 8:09 AM, Guido Winkelmann wrote:
> [...]
>>> On sqlite, drop_all() seems to fail to get the order of table drops
>>> right, and consequently runs into a referential
If you go to pypi and actually download the 0.4.5 tar.gz file from the
sqlalchemy project and expand it, the documentation will be there in html form
in the doc/ directory.All sqlalchemy releases include an html build of the
documentation in this directory in the source distribution.
Sent f
e tradeoff here is basically between “more work with SQLAlchemy” vs.
“not possible at all with other ORMs” :)
The relational model is the more rigid part of the system here, so you have to
work that part out first; then determine how you want to map the Python
object model on top of the relational m
joe meiring wrote:
> So I've got a model like such and using sqlalchemy v0.9.8
>
> class myModel(Base):
>
>
> id
> = Column(Integer, primary_key=True)
>
> border
> = Column(JSONB)
> How can I query for rows that don't have a border? I've tried:
>
> filter(myModel.border != None)
object
make that work completely, with the more verbose use pattern.
then when that is totally working and understood, then move onto association
proxy:
http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/associationproxy.html
> On Tuesday, March 31, 2015 at 4:11:51 PM UTC+2, Michael Bayer w
Jeffrey McLarty wrote:
> Hello,
>
> First - amazing work on SQLAlchemy, what an amazing body of work.
>
> Second, my question.
>
> I'm attempting to convert a pure-python object, into a custom type for column
> definition. My question is, do I need to keep my original MyObj(object) and
> u
Duke Dougal wrote:
> I'm trying to find if a row with a given primary key exists.
>
> Is this the "right" way to do it?
it looks fine and if you’re just starting out, by all means do what works
and makes sense to you.
> I'm using Python 3.4 and Sqlite 3.8.2
>
>
> from sqlalchemy.ext.automa
Duke Dougal wrote:
> I am using the Falcon web server and SqlAlchemy core.
>
> I have read warnings about it not being thread safe.
>
> I'm not sure what the implications are of this. Will there be a problem or
> can I code around it somehow?
>
> I'm trying to avoid the ORM for now - at le
; secondaryjoin='and_(MySubClass1.type == 802, MySubClass1.id1 ==
> Left.id)'
> )
>
> class Left(db.Model):
> id = db.Column(db.Integer, primary_key=True)
>
> MyClass is used as a junction table for a bunch of different relationships,
> t
Sibylle Koczian wrote:
> Am 29.03.2015 um 22:47 schrieb Werner:
>> Had similar issue with wxPython-Phoenix and pip with 3.4.0 was very far
>> behind, don't know about 3.4.3.
>>
>> pip 6.0.8 and setuptools 12.2 fixed it for me
>
> pip 6.0.8 was installed, setuptools was on 12.0.5, same as on m
ying zhang wrote:
>
>
> I'm confused with how Query.with_lockmode('update') works in sqlalchemy.
> My code is in attachment.
> For testing, I start test.py in 1st terminal, then start test.py in 2nd
> terminal.
> so the 2nd termial will read the data modified by 1st test.py.
> But the 2nd te
it’s not an option available at the moment, though there might be ways to avoid
the collection loads (artificially zeroing them out w/o history).
if you don’t need the relationship features then you might as well just use
query.delete().
Jonathan Vanasco wrote:
> I'm running a migration scr
Pierre B wrote:
> Hi all,
>
> I'm ultimately trying to have different default values for the same column.
> Following the documentation, the @declared_attr.cacading decorator seems to
> be the best approach.
> Here's my code:
> class HasSomeAttribute(object):
> @declared_attr.cascading
>
SQLAlchemy release 1.0.0b4 is now available.
This release contains a handful of fixes and enhancements mostly
to address issues that were reported by beta testers. Things
are looking very good and it's hoped that *maybe* this will be the
last beta, unless a host of new regressions are reported.
this is a pip issue; first ensure you’re on the latest version of pip. If the
error persists, please report it to https://github.com/pypa/pip/issues.
Sibylle Koczian wrote:
> Hello,
>
> I can't upgrade SQLAlchemy any more on just one of several Windows PCs.
> Windows version is Windows 7 S
I’d probably try to order_by(text(“union_date”)) so that it isn’t
interpreted as a column object.
If that doesn’t work, then the query here should use a simple Core union
object, and then a new query
session.query(my_union.c.union_date).distinct().order_by(my_union.c.union_date).
pidev...@gmai
Im trying to avoid having to write a full example for you from scratch so if
you could provide everything in one example, both models and where you want
the relationships, with all the columns, we can work from there, thanks.
Adrian wrote:
> In case it's unclear what exactly I'm trying to do, h
Andrew Millspaugh wrote:
>
> I'm pretty inexperienced with SQLAlchemy. I mostly want to know the best way
> to deal with a relationship like this. I am trying to avoid adding a fake
> relationship directly between F and A, as it could get out of sync with the
> actual nested relationship. I
e docs works (I think).
>
> On Tuesday, March 24, 2015 at 4:47:42 PM UTC-7, Michael Bayer wrote:
>
>
> Andrew Millspaugh wrote:
>
> > Yes, I got the style from there.
> >
> > I have a great great great great grandchild that I need to be able to
if yes, my problem is solved :)
>
>
> On 03/24/2015 10:33 AM, Michael Bayer wrote:
>> Richard Gerd Kuesters | Pollux
>>
>> wrote:
>>
>>
>>> hi all!
>>>
>>> i'm dealing with a little problem here. i have a parent table and
C.b, B.a)
then:
F.query.join(*F.join_to_a())
>
> On Tuesday, March 24, 2015 at 6:28:31 AM UTC-7, Michael Bayer wrote:
>
>
> Andrew Millspaugh wrote:
>
> > I've got a class hierarchy that looks something like this:
> >
> > [ A ] 1---
Adrian wrote:
> > the model here doesn’t illustrate how this would be a many-to-many.
> A User can have any number of other Users as a favorite. That looks quite
> many-to-many to me….
then you are referring to a self-referential User -> favorite_user -> User
relationship which is M2M but th
Adrian wrote:
> @declared_attr
> def user(cls):
> """The user owning this favorite"""
> return db.relationship(
> 'User',
> lazy=False,
> foreign_keys=lambda: [cls.user_id],
> backref=db.backref(
> '_favorit
ThiefMaster wrote:
> The is_deleted column is in the User table. If possible I'd rather avoid
> having to replicate it in the favorite tables (hard-deleting favorites is
> fine, I only need soft deletion for users).
the column can be on either side.
I think maybe you want to illustrate the
ThiefMaster wrote:
> Hi,
>
> I have the following models for a "favorite" system:
>
> https://gist.github.com/ThiefMaster/e4f622d54c74ee322282
>
> Now I'd like to restrict the relationship that's created by the backref in
> L24, so it doesn't include any favorited users which have the is_de
/backref.html.
> Le mardi 24 mars 2015 14:23:00 UTC+1, Michael Bayer a écrit :
> the “user” backref here is a relationship() like any other, just specify
> Address.user as the target of the event.
>
> Cyril Scetbon wrote:
>
> > Hi,
> >
> > Is there a way
Richard Gerd Kuesters | Pollux wrote:
> hi all!
>
> i'm dealing with a little problem here. i have a parent table and its two
> inheritances. there is a value that both children have and must be unique
> along either types. is there a way to move this column to the parent and use
> a constr
Andrew Millspaugh wrote:
> I've got a class hierarchy that looks something like this:
>
> [ A ] 1* [ B ] 1-* [ C ] 1--* [ D ] 10..1 [ E
> ] 1..*--0..1 [ F ]
>
> orgprojticketsnap
> bidl
the “user” backref here is a relationship() like any other, just specify
Address.user as the target of the event.
Cyril Scetbon wrote:
> Hi,
>
> Is there a way to add an event listener on a backref ?
>
> I have something like :
>
> class User(Base):
>
>
> __tablename__ = 'user'
>
>
Edgaras Lukoševičius wrote:
> A quick script with SQL table schema.
won’t work with MySQL. The ability to send a pure string SQL statement
directly to execute() in conjunction with a straight tuple, and have it
magically expand out to an IN, is a psycopg2 / postgresql specific feature.
> If t
Kent wrote:
> In cases where we interact with the database session (a particular
> Connection) to, for example, obtain an application lock which is checked out
> from database for the lifetime of the database session (not just the duration
> of a transaction), it is important that I guarante
the before_parent_attach() event could do this, sure. Might be a little tricky:
http://docs.sqlalchemy.org/en/rel_0_9/core/events.html?highlight=before_parent_attach#sqlalchemy.events.DDLEvents.before_parent_attach
Richard Gerd Kuesters | Pollux wrote:
> hi all!
>
> i remember bumping into th
dcgh...@gmail.com wrote:
> Hello there,
>
> I have the following code structure (more or less) in several processes:
>
> from sqlalchemy import create_engine
> from sqlalchemy.orm import sessionmaker
>
> engine = create_engine(some_mysql_dburi)
> session = sessionmaker(bind=engine)()
>
> wh
Jonathan Vanasco wrote:
> Wow. This is noticeably faster.
that’s good to hear, I was able to chip away at overhead in many areas
though most are relatively small.
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe fro
SQLAlchemy release 1.0.0b3 is now available.
This is an emergency re-release of 1.0.0b2 to repair an erroneous commit,
regarding the
MySQL “utf8mb4” fix which was inadvertently commented out.
Download 1.0.0b3 at:
http://www.sqlalchemy.org/download.html
--
You received this message because y
SQLAlchemy release 1.0.0b2 is now available.
This is the second pre-release in the 1.0.0 series which includes a small
handful of regression fixes and some additional features. We'd like to thank
those who have been beta testing the 1.0.0 series and encourage all beta
testers to upgrade to beta2!
two-man army. Here at SQLAlchemy Inc. we try to always
have a satisfied customer! (if at all possible).
> Again, thank you.
>
>
> Ivan.
>
>
>
>
> On Friday, March 20, 2015 at 1:30:19 AM UTC+2, Michael Bayer wrote:
>
>
> Ivan Evstegneev wrote:
>
> >
r...@rosenfeld.to wrote:
> From what I read in the SQLAlchemy logging configuration documentation, I
> understood that the echo argument on sqlalchemy.create_engine controls
> whether sqlalchemy logging is forced to stdout, but shouldn't affect whether
> log messages are available to log hand
Ivan Evstegneev wrote:
> Hello,
>
>
> First of all I'm new to DBs so please don't hang me on a tree )))
>
>
> I have basic and simple questions(at least it simple for me ^_^ ).
>
> While googling and reading some tutorials about ORM DBs at whole, I still
> cannot build up a logical pictur
Tony Locke wrote:
> Hi, I've encountered a glitch when running py.test over the entire test suite
> with the postgresql+pg8000 dialect:
>
> py.test --dburi postgresql+pg8000://postgres:xxx@localhost:5436/test
>
> the test hangs at:
>
> test/dialect/test_oracle.py::CompatFlagsTest::test_ora8
Hey all -
Alembic 0.7.5 is now available.
This release has a handful of bug fixes and some new features.
Changelog is available at:
http://alembic.readthedocs.org/en/latest/changelog.html#change-0.7.5
Download Alembic 0.7.5 at: https://pypi.python.org/pypi/alembic/0.7.5.post1
Note th
Julio César Gázquez wrote:
> Hi.
>
> I have an inheritance hierarchy on the form, C inherits B (with single table
> inheritance), B inherits A (with joined table inheritance).
>
> The next query works perfectly:
>
> session.query(C)\
>.join(C.related_objects)
>.filter( ... ) # Unre
Brian Findlay wrote:
> I'm having some difficulty using SQLAlchemy's jsonb operators to produce my
> desired SQL.
>
> Intended SQL:
>
> SELECT *
> FROM foo
> WHERE foo.data->'key1' ? 'a'
>
> ...where `foo.data` is formatted like this:
>
> {
> 'key1': ['a', 'b', 'c']
Cyril Scetbon wrote:
> Hi,
>
> After having read
> http://docs.sqlalchemy.org/en/latest/orm/loading_relationships.html I
> understand there is one case where SQL is not emitted and I was expecting
> that my case was this one.
>
> I use polymorphism to store different objects in the same ta
se exc.ResourceClosedError("This result object is closed.")
> sqlalchemy.exc.ResourceClosedError: This result object is closed.
>
>
> As long as I can check that resultset is empty and break from the loop, I am
> fine. Any better way of handling this?
That’s a bug in the or
ctly, SQLAlchemy’s result
proxy works around that issue also, by fetching rows in chunks and converting
the LOB objects to strings while they are still readable, so you could keep
with the fetchmany() calls.
>
> Thank you for your help!
> GP
>
> On Monday, March 16, 2015 at 5:
GP wrote:
> So that's what was happening:
>
> This select construct fails:
> select_query = select()
> select_query.append_column(contract_id)
> select_query.append_column(cancel_dt)
> select_query.append_column(cancellation_obj)
> select_query.append_from(source_table_name)
>
>
> But this s
GP wrote:
> Hello,
>
> While trying to insert into an Oracle table with one column defined as CLOB,
> I get the following error:
> File
> "/home/x/.local/lib/python3.4/site-packages/sqlalchemy/engine/default.py",
> line 442, in do_execute
> cursor.execute(statement, parameters)
> sq
g(255))
>> description = deferred(
>> Column(Text()),
>> group="full"
>> )
>>type_ = Column( String(30), nullable=False)
>> """
>>
>> and a child model
>> """
>> class Element(DBB
tonthon wrote:
> Sorry I was a bit too speed when writing that one :)
>
> So I've got a Base model :
> """
> class Base(DBBASE):
>__tablename__ =
> 'base'
>__mapper_args__ = {'polymorphic_identity': 'base', 'polymorphic_on':
> 'type_
tonthon wrote:
> Hi,
>
> I'm using polymorphism and I set up some deferred columns at each level
> of inheritance belonging to the same deferred group :
>
> """
> class Base(DBBASE):
>id = Column(Integer, primary_key=True)
>name = Column(String(255))
>description = deferred(
>
Hey list -
I’m very pleased to announce SQLAlchemy’s first foray into the world of
“1.0”, which is our 1.0.0b1 release.
As 1.0.0b1 includes “b1”, this is a “beta” release, intended for widespread
evaluation. Assuming you’re all using a modern version of pip, it should not
install automatically un
moon...@posteo.org wrote:
> On 2015-03-12 09:53 Michael Bayer wrote:
>> which is why, “copy an object” is not an out of the box thing. Because
>> nobody really wants a full “copy”, it’s something custom.
>
> As I described I don't want a "full copy".
Francesco Della Vedova wrote:
> Hello,
>
> I have a set of models that I would like to replicate on different Postgres
> schemas. The name of the schema is only known at runtime.
> Just as an example, imagine I have a bunch of tables of customer data, and I
> want to create a schema 'custo
moon...@posteo.org wrote:
> On 2015-03-08 11:17 Michael Bayer wrote:
>> there’s no particular “SQLAlchemy way” to do this,
>
> What is about
> make_transient()
> ?
>
> I don't understand this function 100%tly.
it changes the state of an object from per
Julien Cigar wrote:
>
> Hi Mike,
>
> Sorry to bother you once with this, but I've re-read all the docs on
> the relationships and I want to be sure that I've understand correctly.
>
> Imagine I have the following "link" table in SQL:
> https://gist.github.com/silenius/77d406f8e0c0e26eb38f wi
moon...@posteo.org wrote:
> On 2015-03-08 11:17 Michael Bayer wrote:
>> new_obj = MyClass()
>> for attr in mapper.attrs:
>>setattr(new_obj, attr.key, getattr(old_obj, attr.key))
>
> This would copy everything including primary keys and unique members.
which
SQLAlchemy release 0.9.9 is now available.
Release 0.9.9 is a large maintenance release featuring 30 changes, mostly
bug fixes. A handful of modest feature adds are also present, including new
Core features for SQLite, Postgresql, and new API features to provide better
control of transaction isola
But, once I know that within
> before_cursor_execute, can I (recursively) issue an conn.execute() for that
> statement safely or will it affect the original execute?
if you stick with the DBAPI connection directly then you’re definitely safe.
>
>
>
> On Saturday, March 7, 2
moon...@posteo.org wrote:
> On 2015-03-07 03:17 wrote:
>> Is there a in-build-function to duplicate the instance of a data
>> object (except the primary key)?
>
> Isn't there a way for this?
>
> Does the sqla-devs reading this list?
there’s no particular “SQLAlchemy way” to do this, there’s
Kent wrote:
> I'm implementing database session variables (in Oracle,
> DBMS_SESSION.SET_CONTEXT(...)), in order to be able to set (from sqlalchemy)
> and retrieve (from a database trigger) the application userid and URL path
> during table audit triggers.
>
> The tricky bit is that if I se
Dani Hodovic wrote:
> I've been struggling with a query that gets the most recent date as described
> here: http://stackoverflow.com/a/123481/2966951
>
> I've been able to produce a SQLAlchemy variant, but it seems to be MUCH
> slower when executed with MySQL. It also looks slightly differen
SQLRook wrote:
> To move one step from your sample toward my codebase, I made a class method
> to modify the pickled list. Already, I see behavior that I cannot explain.
> If the session is passed to modifyTarget(), you can observe the
> targetInstance become dirty, marked as modified, and
J.D. wrote:
> My solution didn't work. I was able to get my Portuguese data to load by
> decoding it in ISO-8859-1, but by decoding I lose all the special characters
> like tildes.
>
> So I still don't understand how to get the engine to accept my data properly.
>
> J.D.
>
> On Tuesday, Ma
Evan James wrote:
> Hi folks,
>
> I'm working on a SQLAlchemy-based app where we've decided to make some
> infrastructure changes, in particular moving from reflection to declaration
> for mapping the models.
>
> However, we're now running into issues where, after switching to declarative,
Russ wrote:
> What is the recommended way to handle connection pooling when there will be a
> small fixed set of database users (eg: 2) connecting?
>
> For example, the two users may be:
>
> `app`: the main user used by the application with full r/w privs
> `readonly`: limited SELECT-only us
_modified(targetInstance)
e = create_engine("sqlite://", echo=True)
Base.metadata.create_all(e)
s = Session(e)
run(s)
s.commit()
s = Session(e)
assert s.query(Target.targetList).scalar() == [4, 5, 6]
>
>
> On Saturday, February 28, 2015 at 11:17:28 AM UTC-5, Michael Bayer
Julien Cigar wrote:
> On Sun, Mar 01, 2015 at 01:53:30PM +0100, Julien Cigar wrote:
>> On Fri, Feb 27, 2015 at 11:38:05PM -0500, Michael Bayer wrote:
>>>> On Feb 26, 2015, at 5:56 AM, Julien Cigar wrote:
>>>>
>>>>> On Wed, Feb 2
Jonathon Nelson wrote:
> For a variety of reasons, sometimes it's nice to be able to do something like
> this:
>
> with dbsess.begin(rollback=True):
>do_stuff
>
> Where the expected behavior is that everything in the context runs in a
> transaction, but upon exiting the context we issue
ersions of the APIs right now would involve
aggregating changes across flushes, probably using flush events.
> --Eric
>
> On Fri, Feb 27, 2015 at 9:17 PM, Michael Bayer
> wrote:
>
>
>
> On Feb 27, 2015, at 4:48 PM, Eric Smith wrote:
>
>> To those more exper
SQLRook wrote:
> I'm having an issue where a list of user-defined objects is disappearing as a
> function goes out of scope. The list is stored in a PickleType column, and
> as that type does not track changes in the objects of the list, I am
> (knowingly, inefficiently) forcing the column
> On Feb 26, 2015, at 5:56 AM, Julien Cigar wrote:
>
>> On Wed, Feb 25, 2015 at 06:10:55PM -0500, Michael Bayer wrote:
>>
>>
>> Julien Cigar wrote:
>>
>>>> On Thu, Feb 19, 2015 at 11:31:10AM -0500, Michael Bayer wrote:
>>>> Jul
> On Feb 27, 2015, at 4:48 PM, Eric Smith wrote:
>
> To those more experienced than me, does this behavior make sense? If so,
> could you further my education with an explanation?
>
> If I change an attribute, is_modified returns True (as expected).
> If I then reference a relationship, is_m
Julien Cigar wrote:
> On Thu, Feb 19, 2015 at 11:31:10AM -0500, Michael Bayer wrote:
>> Julien Cigar wrote:
>>
>>> On Thu, Feb 19, 2015 at 02:45:43PM +0100, Julien Cigar wrote:
>>>> Hello,
>>>>
>>>> I'm using SQLAlchemy 0.
Christopher Singley wrote:
> I'm using declared_attr.cascading from sqlalchemy-1.0.0dev to declare a
> foreign key on a subclass that also needs another separate foreign key
> reference to the parent table.
> To let the Mapper know which column to join for the polymorphic inheritance
> relat
> On Feb 22, 2015, at 10:09 PM, Ed Rahn wrote:
>
> I am occassionally and randomly getting a DetachedInstanceError when I try to
> access an object atttribute that is a reference. I will run this several
> thousand times and only get it twice. What I don't understand is I use the
> same ex
function that does something similar for other fields that are not the PK.
The recipe below is one way to do this.
https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/UniqueObject
>
>> On Thursday, February 19, 2015 at 5:29:56 PM UTC+1, Michael Bayer wrote:
&g
Julien Cigar wrote:
> On Thu, Feb 19, 2015 at 02:45:43PM +0100, Julien Cigar wrote:
>> Hello,
>>
>> I'm using SQLAlchemy 0.9.8 with PostgreSQL and the reflection feature of
>> SQLAlchemy.
>>
>> I have the following tables (only relevant parts are show):
>> https://gist.github.com/silenius/390
Maurice Schleußinger wrote:
> Is there no other way?
>
> http://stackoverflow.com/questions/27635933/how-can-i-know-which-fiels-cause-integrityerror-when-inserting-into-a-table-with/27884632#27884632
>
> Parsing an exception with regex just doesn't feel right…
The two other ways are that you
Ed Rahn wrote:
>
> On 02/13/2015 11:30 PM, Michael Bayer wrote:
>> Ed Rahn wrote:
>>
>>> I have several programs that are Multi Process and long running, they open
>>> up 30 or so connections and do selects periodically. For a select query,
>
the order in which you put things into session.add() is significant only
within the scope of a certain mapped class, that is, the order that you put
a bunch of Foo() objects into session.add() will be maintained, however a
series of Bar() objects are handled separately.
Between different object hi
S P wrote:
> I am using SQLAlchemy version 0.9.7. I have ~ 400 tables that I
> automatically reflect from the database. I would like to cPickle the
> metadata after reflection and store this, then subsequently unpickle the
> metadata and use it (for speedup) rather than use reflection agai
ahmadjaved...@gmail.com wrote:
> Hi,
>
> I am working on a web site using Python Django and SQLAlchemy ORM. I want to
> do all read operations in separate database and write operations in separate
> database.
> So I tried Mike Bayer's solution
> (http://techspot.zzzeek.org/2012/01/11/django
Ed Rahn wrote:
> I have several programs that are Multi Process and long running, they open
> up 30 or so connections and do selects periodically. For a select query,
> the default behaviour is to begin a transaction if not currently in one,
> but not commit afterwards. This leaves a large numb
Torsten Irländer wrote:
> First, thanks for your fast replies Michael!
>
> Do I understand it correctly that in contrast to plain SQL (Invoking the
> delete command in e.g psql), there is no way to make the database side
> constraints in the association table applicable in SQLAlchemy if I co
1 - 100 of 10918 matches
Mail list logo