On Wed, May 3, 2017 at 10:47 AM, David Chanin wrote:
> Hi Everyone,
>
> We just open-sourced a custom lazy loader for SQLAlchemy that does bulk lazy
> loading of relations - essentially a lazy subqueryload. The idea is that
> whenever a relation is lazy-loaded on a model, the
On Mon, Apr 24, 2017 at 10:26 PM, Jonathan Vanasco
wrote:
>
> On Monday, April 24, 2017 at 4:28:22 PM UTC-4, Mike Bayer wrote:
>>
>> yeah just load the object again w/ the eagerloads option you want.
>
>
>
> Thanks. I was hoping there was a way to just say
s why i want pass columns in query method dynamically. can
> you suggest me how can achieve this.
>
>
> On Wednesday, April 5, 2017 at 5:08:50 PM UTC+5:30, Simon King wrote:
>>
>> On Wed, Apr 5, 2017 at 11:10 AM, Mayank Soni <mayank...@gmail.com> wrote:
>> > I am
On Wed, Apr 5, 2017 at 11:10 AM, Mayank Soni wrote:
> I am trying to pass list of columns of table into query method using
> add_columns method. Below i am mentioning code snipped.
>
> def LLL():
> Base = automap_base()
> class AAA(Base):
> __tablename__ =
On Mon, Mar 13, 2017 at 1:50 PM, mike bayer <mike...@zzzcomputing.com> wrote:
>
>
> On 03/13/2017 08:34 AM, Simon King wrote:
>>
>> Hi,
>>
>> I'm not sure if the problem I've got is a bug or intended behaviour.
>> Here's a test script:
>>
>&g
On Fri, Mar 10, 2017 at 4:12 PM, Alessandro Molina
wrote:
>
>
> On Fri, Mar 10, 2017 at 3:40 PM, mike bayer
> wrote:
>>
>> If this is truly, "unexpected error but we need to do things", perhaps you
>> can use before_flush() to memoize the
On Mon, Mar 6, 2017 at 1:28 AM, Vijaya Sekar wrote:
> Hello everyone,
>
> I have parent table which holds the primary keys of several child tables.The
> child table are got as a list . Using SQLalchemy ORM, how can I join
> multiple child tables to this parent?
>
Can
On Fri, Feb 17, 2017 at 10:03 AM, wrote:
> I want to achieve something like this:
>
> Base = declarative_base()
>
> # the abstract base, no table generated for it
> class TreeNode(Base):
> __abstract__ = True
> parent = Column(ForeignKey('child_class_table.id'),
On Thu, Dec 15, 2016 at 10:00 AM, Simon King <si...@simonking.org.uk> wrote:
> On Thu, Dec 15, 2016 at 2:07 AM, Matt <m...@ramwise.com> wrote:
>>
>>
>> On Wednesday, December 14, 2016 at 3:58:19 PM UTC+1, Mike Bayer wrote:
>>>
>>>
>&
On Thu, Dec 15, 2016 at 2:07 AM, Matt wrote:
>
>
> On Wednesday, December 14, 2016 at 3:58:19 PM UTC+1, Mike Bayer wrote:
>>
>>
>> When you want to switch between "writer" and "reader", the "reader" must
>> be fine with using a totally clean transaction and that means totally
>>
The "transaction" package is a system for coordinating transactions
between multiple systems:
https://pypi.python.org/pypi/transaction
For example, it could coordinate transactions between multiple SQL
databases, using 2-phase commit to ensure that either all are
committed or none are
I don't know if this is part of your problem, but:
1. metadata.create_all(Session.connection()) will not mark the session as dirty
2. Session.flush() is a no-op if the session is clean - it won't even
fire the "after_flush" event
3. ZopeTransactionExtension uses the after_flush event (or
You can provide a function for the default value, and the function can
receive the current statement context as a parameter. This context
gives you access to the rest of the insert statement, including values
of other parameters:
On Fri, Nov 18, 2016 at 11:43 AM, Santosh Sharma
wrote:
> I am using SQLAlchemy and postgres database.
>
> I want to do "Delete and Insert operation" on the table in a single
> transaction without using orm.
>
> Say
> table User
> Column | Type|
On Fri, Nov 11, 2016 at 1:53 PM, Michael Williamson wrote:
>
>> I think your code is basically fine, you've just got a mistake on the
>> last line. Presumably you meant to query Person, not Person.born?
>
>
> I want Person.born so that I don't have to get the entire object. It
On Fri, Nov 11, 2016 at 12:20 PM, Michael Williamson wrote:
> I'm using hybrid_property, and would like the key of the property to be set
> to the attribute name, rather than the name of the getter. This is because
> I'm generating a getter function based on some args, rather
On Fri, Nov 11, 2016 at 6:59 AM, Alfred Soeng wrote:
> It's the issue in the inheritance:
> What I want to do is like this:
> class Employee(Base):
> __tablename__ = 'employee'
> id = Column(
> Integer,
> primary_key=True,
> )
> type_name =
On Fri, Nov 11, 2016 at 7:59 AM, Muhammad Aldo Firmansyah
wrote:
> I want to make API using flask, flask-restless and flask sqlalchemy.
> Database using postgres
>
> Here's my model. The relation below is one-to-many (User have one or many
> tasks. And a task is
Whoops, yes, you're right. You should be able to simplify the
relationship definition to a simple "primaryjoin" clause, no need for
any of the "secondary" stuff.
Simon
On Thu, Nov 10, 2016 at 1:41 PM, Dorian Hoxha wrote:
> Note that you're joining with User, which I
s for a product, but only 1 filtered by user_id) ?
>
>
> On Thu, Nov 10, 2016 at 11:53 AM, Simon King <si...@simonking.org.uk> wrote:
>>
>> On Thu, Nov 10, 2016 at 9:32 AM, Dorian Hoxha <dorian.ho...@gmail.com>
>> wrote:
>> > So I have:
>> >
&
On Thu, Nov 10, 2016 at 9:32 AM, Dorian Hoxha wrote:
> So I have:
>
> class Thing():
> current_user_like = relationship(Like)
>
> class User():
> pass
>
> class Like():
> user_id = Column(primary_key=True)
> thing_id = Column(primary_key=True)
>
>
> Now I
at 10:12 AM, Dorian Hoxha <dorian.ho...@gmail.com> wrote:
> Hi Simon,
>
> It all works. All I need is how to do:
>
> Model.query.options(load_only(Model.array[1])).all() ?
>
>
> Thanks
>
>
> On Tue, Nov 8, 2016 at 10:56 AM, Simon King <si...@simonking.org
On Fri, Nov 4, 2016 at 8:13 AM, James Burke wrote:
> Hi All,
>
> I've run into a odd problem, where calling the count function hangs my code
> indefinitely. The odd thing is it was working until recently, so I'm a
> little confused.
>
> customer =
>
gt; For Pyramid, another interesting package is SQLTap, which provides useful
> informations about execution of SQLAlchemy queries...
>
> Best regards,
> Thierry
>
> 2016-10-31 11:05 GMT+01:00 Simon King <si...@simonking.org.uk>:
>>
>> On Sun, Oct 30, 2016 at 9:36
On Sun, Oct 30, 2016 at 9:36 PM, Alfred Perlstein
<alfred.perlst...@gmail.com> wrote:
> Hello,
>
> I wanted to start this out with a big thanks to the community, especially
> Mike Bayer, Simon King, and Jonathan Vanasco.
>
> A few weeks ago I asked for help on debugging
> On 28 Oct 2016, at 21:47, Jonathan Vanasco wrote:
>
> oh great! `session.info["request"]` solved all my problems quite nicely. i
> integrated that my pipy sessions manager.
>
> Simon, thanks. Looking at your code, I recall that `dbsession.remove()` may
> be better than
On Fri, Oct 28, 2016 at 3:19 AM, mike bayer wrote:
>
>
> On 10/27/2016 09:41 PM, Jonathan Vanasco wrote:
>>
>> I have an edge-case in a few situations where, within an @property of a
>> SqlAlchemy object, I need to know the current active web-request/context.
>>
>> I'm
On Tue, Oct 25, 2016 at 10:46 PM, Robert C
wrote:
> I am modeling a simple hierarchical database structure. My model is designed
> as follows:
>
> class ChatMessage(Base):
> __tablename__ = 'chat_message'
> sender_id = Column(Integer,
On Thu, Oct 20, 2016 at 12:11 PM, Lele Gaifax wrote:
> Hi all,
>
> I'd like to have an Entity able to be "attached" to N different others,
> avoiding the need of N intermediate/secondary tables.
>
> I imagine something like the following::
>
> class Address(Base):
>
On Fri, Oct 14, 2016 at 4:56 AM, Ulhas Kanaskar wrote:
> [root@test01 powa-web-3.0.1]# ./powa-web
>
> Traceback (most recent call last):
>
> File "./powa-web", line 2, in
>
> from powa import make_app
>
> File
You could use the before_cursor_execute event to log the SQL based on
some debugging flag.
http://docs.sqlalchemy.org/en/latest/core/events.html#sqlalchemy.events.ConnectionEvents.before_cursor_execute
For example:
from sqlalchemy import event
DEBUGGING = False
@event.listens_for(SomeEngine,
> On 7 Oct 2016, at 14:33, Ludovic Beliveau wrote:
>
> Hi,
>
> I know this subject has been covered many times in this group and I've read a
> lot on it in the past few days. But there is still something that I can't
> explain/understand with detached object.
>
> The
On Mon, Oct 3, 2016 at 11:43 AM, Jinghui Niu wrote:
> This really helps. Thank you Simon! I still have a couple of smaller
> questions.
>
>> When you access .fullname, the "self" parameter is now the
>> *class*, so self.firstname and self.lastname are SQLAlchemy column
>>
y current code? Or maybe you could please point out a link
>> to where I can explore further on the python to SQL transition? Thank you so
>> much.
>>
>> Jinghui
>>
>> On Mon, Oct 3, 2016 at 1:27 AM, Simon King <si...@simonking.org.uk> wrote:
>>>
On Mon, Oct 3, 2016 at 7:17 AM, Jinghui Niu wrote:
> I have a ledger table and a corresponding python class. I defined the model
> using SQLAlchemy, as follows,
>
> class Ledger(Base):
> __tablename__ = 'ledger'
>
> currency_exchange_rate_lookup = {('CNY', 'CAD'):
On Thu, Sep 29, 2016 at 6:32 AM, Jinghui Niu wrote:
> The documentation shows that hybrid_property should used as a decorator,
> like:
> @hybrid_property
> def my_property(self):
> pass
>
>
> What if I wanted to give this hybrid property a name by referring a variable
>
On Tue, Sep 20, 2016 at 5:36 AM, Rahul Ahuja wrote:
> Thanks for the swift reply, Mike! Unfortunately, I had some trouble running
> your code. I'm getting
> base = automap_base(MetaData())
> File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/automap.py",
> line
On Fri, Sep 16, 2016 at 10:49 AM, Jinghui Niu wrote:
>> If you still want to store it as a string, I guess you'll need to try
>> parsing it as a datetime and then fall back to parsing it as a date.
>
>
> Exactly! That's my intention. I'm so excited that my idea has affirmed
ng by making. So I would
>> like to try all the new features for later tasks.
>>
>> I'm fascinated by hybrid_property, but is stuck now when trying to
>> dispatch functions at the SQL expression level.
>>
>> Jinghui
>>
>> On Fri, Sep 16, 2016 at 1:34 AM, Simon K
Ignore SQLAlchemy for the moment and describe what you are trying to
achieve. It looks like you want to store dates and times as strings in
your database (rather than the appropriate type), and yet still be
able to perform date-related operations on them qhen querying. Is that
right? Is there a
():
"Convert SQLAlchemy warnings to exceptions"
import sqlalchemy.exc
warnings.simplefilter(
'error',
sqlalchemy.exc.SAWarning
)
Simon
On Thu, Sep 15, 2016 at 3:09 PM, Simon King <si...@simonking.org.uk> wrote:
> According to https://docs.python.org/2
According to https://docs.python.org/2/using/cmdline.html#cmdoption-W,
the full form of -W (and PYTHONWARNINGS) is:
action:message:category:module:line
Empty fields are ignored, and unused trailing fields can be left out,
so maybe "error::SAWarning" would work?
Simon
On Thu, Sep 15, 2016
> On 3 Sep 2016, at 01:36, HP3 wrote:
>
> Thank you Mike,
>
> I will strongly consider creating a PR for an alternative solution.
>
> I would need to dig into the library to learn the basics of sqlalchemy
> architecture though. So far, I have only used 0.9.x and
By default, the session is flushed before any query, so that the query
results are consistent with changes you may have made in-memory:
http://docs.sqlalchemy.org/en/latest/orm/session_basics.html#flushing
Hope that helps,
Simon
On Fri, Sep 2, 2016 at 5:12 PM, HP3
thon2.7/site-packages/sqlalchemy/util/_collections.py",
> line 212, in __getattr__
>
> raise AttributeError(key)
>
> AttributeError: hosts
>
>
> On Fri, Aug 26, 2016 at 1:33 AM, Simon King <si...@simonking.org.uk> wrote:
>>
>> On Fri, Aug 26, 201
> On 26 Aug 2016, at 21:42, adaptable (Metaframework)
> wrote:
>
> Hi all,
> this comment on Github is well formatted:
>
> https://github.com/zzzeek/sqlalchemy/pull/295#issuecomment-242834334
>
> I see the wrong todo.id after the commit (a log string instead 1)
>
>
On Fri, Aug 26, 2016 at 2:24 AM, Robert Minsk wrote:
> I am using automap_base to reflect a table.
>
> metadata = MetaData()
> metadata.reflect(bind=engine, only=['hosts'])
> automap = automap_base(metadata=metadata)
> automap.prepare()
>
> Hosts = automap.classes.hosts
>
> The
On Wed, Aug 24, 2016 at 2:55 AM, Jinghui Niu wrote:
> Hi, I wonder if there is any recommendation or best practice on choosing
> between
> hybrid_property
>
> and
> hybrid_method
> ,
> other than they hybrid_method can take arguments? If I use the hybrid_method
> only
On Mon, Aug 22, 2016 at 10:12 AM, Piotr Dobrogost
wrote:
> I'd like to map a class onto table and automatically get __init__() method
> per
>
On Thu, Aug 11, 2016 at 8:30 AM, Wibowo Arindrarto
wrote:
> Dear all,
>
> I have a little problem with getting object states that have been flushed
> but not committed. As far as I understand, SQLAlchemy does not have an
> official object state corresponding to this.
It looks like an exception is occurring, which SQLAlchemy has caught
and is now trying to roll back the transaction before re-raising the
initial exception. However, a second exception has occurred during the
rollback, so you can no longer see the original exception.
The second exception looks
On Thu, Jul 28, 2016 at 4:33 AM, Andrew M wrote:
> Okay, thanks Mike for your comprehensive reply. There is still so much to
> learn ... *sigh*.
>
> Perhaps it's worth including a sentence or two in the docs, helping
> overconfident people like myself to understand the
lem when
> using sqlalchemy as an ORM.
>
> Brgds,
>
> Rogier
>
> On Monday, 25 July 2016 13:15:11 UTC+2, Simon King wrote:
>>
>> ...and the reason that it works on the older tables is probably that
>> they use the MyISAM engine rather than InnoDB.
>>
>
...and the reason that it works on the older tables is probably that
they use the MyISAM engine rather than InnoDB.
On Mon, Jul 25, 2016 at 12:05 PM, Mehdi gmira wrote:
> Maybe you forgot to commit ?
>
>
> Le lundi 25 juillet 2016 12:08:17 UTC+2, Rogier Eggers a écrit :
>>
>>
On Fri, Jul 22, 2016 at 3:25 PM, TomS. wrote:
> On 07/19/2016 06:41 PM, Mike Bayer wrote:
>
>
>
> On 07/19/2016 11:51 AM, TomS. wrote:
>
> Hi,
>
> We have Flask app which uses SQLAlchemy. Weird error started to happen
> recently. The difficulty is that we can't reproduce the
On Thu, Jul 21, 2016 at 5:58 PM, Jonathan Vanasco <jvana...@gmail.com> wrote:
>
>
> On Thursday, July 21, 2016 at 12:15:40 PM UTC-4, Simon King wrote:
>>
>> There are some hints for keeping references to objects at:
>>
>>
>> http://docs.sqlalchemy.or
There are some hints for keeping references to objects at:
http://docs.sqlalchemy.org/en/latest/orm/session_state_management.html#session-referencing-behavior
Simon
On Thu, Jul 21, 2016 at 5:11 PM, Mehdi gmira wrote:
> Yeah I thought of that. I find it awkward because you
On Thu, Jul 21, 2016 at 3:29 PM, Mehdi gmira wrote:
> Is there a way to explicitely add objects to the identity map ? I would like
> to be able to do something like:
>
> foos = session.query(Foo).all()
> add_to_identity_map(foos)
I don't understand the question - objects
On Wed, Jul 20, 2016 at 9:44 PM, bkcsfi sfi wrote:
> I have a legacy MySQL database that I am working with sqla version 1.0.11
> and MySQL-Python engine (just upgraded to 1.0.14, problem persists)
>
> I use automap_base and prepare with reflect=True
>
> some of the tables in
I don't create _pg_query using splitted_query_cls=False (with std Query
> class), then _pg_query invokation of methods (all(), one() and other) will
> always apply overrided methods (because it uses SplittedDataQuery).
> But, if I create _pg_query by defined way, it creates new session and, s
Could you describe what you are trying to achieve? There's nothing
about Mike's suggestion that means you need to create a new session -
you can reuse any existing session.
What does your CustomQueryCls do? Perhaps there's another way of doing
what you want?
Simon
On Tue, Jul 12, 2016 at 11:09
On Wed, May 11, 2016 at 10:37 AM, Piotr Dobrogost
<p...@2016.groups.google.dobrogost.net> wrote:
>> On Wednesday, May 11, 2016 at 11:03:57 AM UTC+2, Simon King wrote:
>>> On Wed, May 11, 2016 at 9:39 AM, Piotr Dobrogost
>>>
>>> What's the reaso
On Wed, May 11, 2016 at 9:39 AM, Piotr Dobrogost
wrote:
> On Monday, May 9, 2016 at 5:05:11 PM UTC+2, Mike Bayer wrote:
>>
>>
>> the only thing that is sigificant with "mock" is the first part of the
>> URL. You can just send the whole URL though, so just
On Tue, May 10, 2016 at 12:37 PM, Piotr Dobrogost
wrote:
> On Monday, May 9, 2016 at 5:05:11 PM UTC+2, Mike Bayer wrote:
>>
>>
>> the only thing that is sigificant with "mock" is the first part of the
>> URL. You can just send the whole URL though, so just
On Tue, Apr 26, 2016 at 1:28 PM, Duke Dougal wrote:
> Hi folks,
>
>
> Model is below plus error message below that.
>
>
> I am trying to create some array columns using Alembic but getting errors.
>
>
> Any help valued.
>
>
> thanks!
>
>
>
> from sqlalchemy import Column,
> On 24 Apr 2016, at 13:50, Jimmy Thrasibule wrote:
>
> I'm working on a SQLAlchemy defining a bunch of mixin classes that
> applications should be able to import and extend their model.
>
> When looking at the documentation, mixin classes are create knowing the
>
g
> target.overview_flavor.rating_count += 1
>
>
> event.listen(ProductOverviewReview, 'after_insert',
> reviews_after_insert_listener)
>
>
> четверг, 25 февраля 2016 г., 15:41:03 UTC+2 пользователь Simon King
> написал:
>>
>> Er, ok. There are simpler ways to
It sounds like the transaction for task B is starting before A's
transaction has been committed, but you haven't really given enough
information to debug further. How are you managing your sessions and
transactions? Do B and A actually overlap (ie. does B start before A
finishes)?
Simon
On Tue,
For what it's worth, SQLAlchemy usually does add the join condition for
you, based on your relationship definitions. But the second parameter to
query.join() is an optional expression that *replaces* the join condition
that would normally be generated.
Simon
On Mon, Mar 21, 2016 at 5:42 PM,
On Mon, Mar 21, 2016 at 5:21 PM, wrote:
> Hi Michal
>
> > q.join(ReferenceAuthor, ReferenceAuthor.c.Index == 0)
>
> Ah, of course! Thank you very much!
>
> But... ;)
>
> This Python code
>
> return self.session.query(Reference) \
>
Can you extract your code into a single standalone script that demonstrates
the problem? This should be possible even with automap; the script can
start by creating just the tables that are involved in this problem
(ideally in an in-memory sqlite db), then use automap to map classes to
those
On Mon, Mar 21, 2016 at 3:05 PM, wrote:
> On 2016-03-20 13:12 Jonathan Vanasco wrote:
> > .contains_eager('_periodical')\ # this lets sqlalchemy
>
> This eager-loading thing is a nice hint. I will use this in the future.
> Thanks.
>
> I
On Fri, Mar 18, 2016 at 5:12 AM, Krishnakant <krm...@openmailbox.org> wrote:
>
>
> On Thursday 17 March 2016 03:46 PM, Simon King wrote:
>
> On Thu, Mar 17, 2016 at 7:19 AM, Krishnakant <krm...@openmailbox.org>
> wrote:
>
>> Hello,
>> I wish to search
On Thu, Mar 17, 2016 at 7:19 AM, Krishnakant wrote:
> Hello,
> I wish to search rows in my table on the basis of text of json keys.
> My table has vouchercode, voucherdate, dramt, cramt.
> Here dramt and cramt are both jsonb fields (postgresql 9.4).
> dramt containes
> On 17 Mar 2016, at 19:11, Alex Hall wrote:
>
> Hello all,
> It seems like I can't go a day without running into some kind of wall.
> This one is a conceptual one regarding foreign keys. I have to somehow
> get the same FK column in table A pointing to IDs in tables B and C.
On Wed, Mar 16, 2016 at 3:23 PM, Piotr Dobrogost <
p...@2016.groups.google.dobrogost.net> wrote:
> On Wednesday, March 16, 2016 at 3:51:16 PM UTC+1, Simon King wrote:
>>
>> On Wed, Mar 16, 2016 at 1:43 PM, Piotr Dobrogost <
>> p...@2016.groups.google.dobrogost.net&g
> On 16 Mar 2016, at 06:45, Krishnakant wrote:
>
> Dear all,
> I have a challenge which is confusing me.
> I have a table called voucher with the following field.
> (vid, vdate,Cr) where vid is integer, vdate is date and Cr is jsonb in
> postgresql.
> Can some one tell
> On 15 Mar 2016, at 22:13, Cecilio Ruiz wrote:
>
> Hi !
>
> Assuming this result:
>
> n = session.query(xx).all()
>
>
> How I can find the id 5 on the 'n' ?
> something like that.:
>
> v = n.get(5)
When you call “all()”, you’ve already loaded all the rows from the
On Thu, Mar 3, 2016 at 12:01 PM, Krishnakant <krm...@openmailbox.org> wrote:
>
>
> On Thursday 25 February 2016 03:50 PM, Simon King wrote:
>
> On Thu, Feb 25, 2016 at 9:43 AM, Krishnakant <krm...@openmailbox.org>
> wrote:
>
>> Hello,
>> I have a que
On Thu, Mar 3, 2016 at 8:27 AM, Lele Gaifax wrote:
> Hi all,
>
> I have a simple m2m relationship between two entities, with a secondary
> table
> in the middle.
>
> From the left item I need to read both the right items and the middle
> ones, so
> I have two relationships
Out of interest, how are you building your query, and why do you need to be
able to change the values afterwards?
Simon
> On 2 Mar 2016, at 21:59, Brian Cherinka wrote:
>
> Thanks, Mike. This is excellent. That did the trick. That's much easier
> than what I was
I don't understand that error - you're asking it to join along predefined
relationships, so it shouldn't need to search for foreign keys at query
time. "Category.products" is a relationship set up as the backref of
Product.categories.
Here's a working example. I had to add the definition of the
http://docs.sqlalchemy.org/en/rel_1_0/orm/tutorial.html#querying-with-joins
You want something like:
DBSession.query(Category).join(‘products’,
‘brand’).filter(Brand.slug==brand_slug)
Hope that helps,
Simon
> On 1 Mar 2016, at 20:11, sector119 wrote:
>
> It works, but
On Tue, Mar 1, 2016 at 4:17 PM, Nana Okyere wrote:
> Mike, thanks for your response. I turned on the echo to see the values.
> Looks like it is passing a datetime.date objects. So I don't see a time
> part of the date. Here's the relevant part of the echo output.
>
> I selected
On Thu, Feb 25, 2016 at 1:19 PM, sector119 wrote:
> Hello,
>
> Can some one help me with that query? I get AttributeError: servings
> I expect that sqlalchemy use update from select for that query or it's not
> possible and I must use select(...).as_scalar() for every
; 0)]).where(
> ProductFlavor.__table__.c.product_id == Product.__table__.c.id)
> connection.execute(
> Product.__table__.update().where(Product.__table__.c.id ==
> target.product_id).values(quantity=quantity))
>
>
> четверг, 25 февраля 2016 г., 11:52:50 UTC
On Thu, Feb 25, 2016 at 12:01 PM, Piotr Dobrogost <
p...@2016.groups.google.dobrogost.net> wrote:
> On Thursday, February 25, 2016 at 11:10:36 AM UTC+1, Simon King wrote
>>
>>
>> I can't think of a way you could do this with objects you've already
>> loaded i
On Thu, Feb 25, 2016 at 9:43 AM, Krishnakant wrote:
> Hello,
> I have a query where there are 2 alias for a single table.
> This is because the table contains a self referencing foreign key.
> the table is (groupcode integer primary key, groupname text, subgroupof
>
On Thu, Feb 25, 2016 at 9:03 AM, Piotr Dobrogost <
p...@2016.groups.google.dobrogost.net> wrote:
> On Wednesday, February 24, 2016 at 2:41:43 PM UTC+1, Piotr Dobrogost wrote:
>>
>> Hi!
>>
>> Let's say I have a model Text with attribute "values" which is
>> association proxy.
>> I can update
On Thu, Feb 25, 2016 at 7:53 AM, 尤立宇 wrote:
> Thanks for your response.
>
> Do you consider using `backref` only on one of the class bad practice?
>
> I'm curious because automatically creating descriptors seems possible to
> me, and I'm wondering when it happens.
>
> As
On Wed, Feb 24, 2016 at 9:51 PM, sector119 wrote:
> Hello!
>
> I have two models, Product and ProductFlavor with one-to-many relationship
> And I have a listener, which I want to update Product.quantity on
> ProductFlavor.quantity change:
>
>
Your class definitions have to be valid Python syntax, and Python doesn't
allow for spaces in attribute names. However, the attribute name can be
different to the actual column name. Try something like this:
hiring_manager = db.Column('Hiring Manager', db.String(120),
primary_key=True)
Hope
t; pyodbc is the only way I've been able to talk to the server at all.
> Add it to SA, though, and that attribute error appears.
>
> On 2/19/16, Simon King <si...@simonking.org.uk> wrote:
> > According to
> >
> http://docs.sqlalchemy.org/en/rel_1_0/core/connections.htm
> If I don't get that, it's because I used a name that complains about
> there being no attribute dbms_ver or server.version, depending on the
> string.
>
> They don't make it easy, do they?
>
> On 2/19/16, Simon King <si...@simonking.org.uk> wrote:
> > URI prefixes
server_info", in case anyone happens to know what that's about. I'm
> getting nightmarish flashbacks to my "has no attribute" error last
> week for the same object. But at least this is a different one; I'll
> count it as a good thing!
>
> On 2/19/16, Simon King <si.
On Fri, Feb 19, 2016 at 2:38 PM, Alex Hall wrote:
> As the subject says, I am connected to our iSeries through straight
> pyodbc. That seems to run perfectly. Now, is there a way to use SA
> with that connection? When I use "ibm_db_sa+pyodbc://..." I get the
> exact same
On Wed, Feb 17, 2016 at 5:29 PM, Horcle wrote:
> I have the following query db.session.query(label('sid',
> distinct(Clinical.patient_sid))) to which I would like to pad a few extra
> columns with constant values, like in the following SQL example
>
> select
On Wed, Feb 17, 2016 at 7:46 AM, Krishnakant wrote:
> Hello all,
> The subject might have made my problem already clear.
> So I am unclear about when I should use the normal Python "and " vs the
> sqlalchemy "and_" while writing where, having or similar queries including
What does the traceback say? That exact line would trigger an error much like
the one you are seeing, if the object in “connection.connection” is a
pyodbc.Connection and doesn’t have a “dbms_ver” attribute.
Note that there are at least 3 packages that could be involved here:
pyodbc
On Fri, Feb 5, 2016 at 2:15 PM, Michal Petrucha <
michal.petru...@konk.org> wrote:
> On Fri, Feb 05, 2016 at 08:24:46AM -0500, Alex Hall wrote:
> > Hi all,
> > What's the recommended way to restrict input? For instance, I store a
> > phone number as an integer, and I need it to have 7, 10, or
301 - 400 of 655 matches
Mail list logo