it does not, and as an exercise I'd recommend trying to theorize how
sorted() *could* make such an effect - and if it did, what assumptions
would it be making? Hopefully this would reveal that the assumptions
the library would need to make in order to even make such a thing happen
would not
Run this:
from sqlalchemy.orm import configure_mappers
configure_mappers()
that ensures RefClass's deferred mapping gets set up appropriately.
On 11/08/2016 01:39 PM, de...@devinfee.com wrote:
First, thanks for your very insightful response. I'm trying to reproduce
what you've provided,
On 11/08/2016 01:03 PM, Vlad Frolov wrote:
I was trying to solve an issue of an incorrect Alembic migration
autogeneration for a custom field (SQLAlchemy-Uitls.PasswordType), which
fallbacks to VARBINARY type for SQLite and it turned out that SQLAlchemy
confuses me:
*from* sqlalchemy
First, thanks for your very insightful response. I'm trying to reproduce
what you've provided, but I'm getting an `InvalidRequestError` when
querying on `RefClass`:
*InvalidRequestError: SQL expression, column, or mapped entity expected -
got ''*
Indeed, RefClass has no `__mapper__`
Here are references to the relevant discussions:
- https://github.com/kvesteri/sqlalchemy-utils/issues/106
- https://github.com/kvesteri/sqlalchemy-utils/pull/233
On Tuesday, November 8, 2016 at 8:03:45 PM UTC+2, Vlad Frolov wrote:
>
> I was trying to solve an issue of an incorrect
I was trying to solve an issue of an incorrect Alembic migration
autogeneration for a custom field (SQLAlchemy-Uitls.PasswordType), which
fallbacks to VARBINARY type for SQLite and it turned out that SQLAlchemy
confuses me:
>>> *from* sqlalchemy *import* VARBINARY
>>> *from*
Hi,
I know this is silly question, but I just need confirmation - Python
'sorted' doesn't affect in any way data stored in DB?
Example:
class PPL(db.Model):
person_pk_id = db.Column(db.Integer, primary_key=True)
person_type = db.Column(db.Integer)
person_order_s =
Thanks a lot, that solved my problem !
On Tuesday, 8 November 2016 17:05:00 UTC+1, Mike Bayer wrote:
>
>
>
> On 11/08/2016 10:40 AM, iro...@kpler.com wrote:
> > Hello,
> >
> > I am struggling with this case and so far, I haven't seen on
> > documentation or on the different posts, a way to
FYI, if you query via the ORM and load_only, the query should be something
like :
SELECT primary_key_column, array[1] FROM table;
The ORM adds the primary key behind-the-scenes so it can setup the objects.
as far as i know, If you need to only load array[1] and not the primary key
column,
On 11/08/2016 10:40 AM, iro...@kpler.com wrote:
Hello,
I am struggling with this case and so far, I haven't seen on
documentation or on the different posts, a way to solve my problem.
Firstly, I cannot have a ForeignKey linking Child to Parent because
Parent has a polymorphic identity, and
Hello,
I am struggling with this case and so far, I haven't seen on documentation
or on the different posts, a way to solve my problem.
Firstly, I cannot have a ForeignKey linking Child to Parent because Parent
has a polymorphic identity, and PostgreSQL is not dealing with ForeignKey
in such
On 11/08/2016 08:00 AM, Sebastian Eckweiler wrote:
Hi there,
I'm having an issue when building queries against a relationship using a
custom primaryjoin.
The issue can be reproduced with a slightly modified Users/Address model
as taken from the docs:
|
Hi there,
I'm having an issue when building queries against a relationship using a
custom primaryjoin.
The issue can be reproduced with a slightly modified Users/Address model as
taken from the docs:
from sqlalchemy import Integer, ForeignKey, String, Column
from sqlalchemy.ext.declarative
If you have an SQLAlchemy session, you would write this:
session.query(Model.array[1]).all()
Assuming your "Model.query" is a shorthand for "session.query(Model)",
you might be able to use:
Model.query.with_entities(Model.array[1]).all()
Simon
On Tue, Nov 8, 2016 at 10:12 AM, Dorian
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 wrote:
> On Tue, Nov 8, 2016 at 9:31 AM, Dorian Hoxha
> wrote:
> > So,
> >
> > I
So,
I want to do "SELECT array[1] FROM table;". Meaning to select only 1
element. Is this possible (didn't find by searching
docs,mailing-list,google).
Though I can do it by normal query.
Thank You
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
16 matches
Mail list logo