o other options at the moment and I need to get this
working soon.
On 2/11/16, Alex Hall <ah...@autodist.com> wrote:
> I think I'm confused. Isn't Pyodbc an alternative to SQLAlchemy? If
> not, how would the two work together? I just looked through the
> 'Getting Started' and 'API' d
Hello list,
I sent this to the ibm_db list yesterday, but no one has responded
yet. Since it's as much ibm_db as SA, I thought I'd try here as well
in case any of you have used an AS400 before. I have ibm_db,
ibm_db_sa, the latest sqlalchemy, and Python 2.7 (latest) installed. I
can talk to SQLite
" ?
>
> Best regards,
> Thierry
>
>
> 2016-02-06 5:16 GMT+01:00 Alex Hall <ah...@autodist.com>:
>
>> Hello all,
>> Another basic question: given an instance of a record, can I somehow
>> delete the record from a table? The longer story is this.
>&g
Hi list,
Thus far, I've been using very basic database actions on a local
SQLite database as I've written the application. Now, though, I have
my GUI able to drive all CRUD operations, and I'm nearing the time
when I'll switch over to the actual system for which I've written the
app: the company's
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 11 digits.
In its getter, I format it so it looks good as a string, and in its
setter, I take the string the user inputs, strip only the integers,
and store
day. Thanks!
--
Alex Hall
Automatic Distributors, IT Department
ah...@autodist.com
--
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 sqlalchem
le, or as well as? Where are you getting the
> object that you are putting in the first element of each of the
> self.choices list?
>
> Simon
>
> On Thu, Feb 4, 2016 at 11:34 AM, Alex Hall <ah...@autodist.com> wrote:
>
>> It's all from a GUI, so it's something like th
4 Feb 2016, at 18:19, Alex Hall <ah...@autodist.com> wrote:
>>
>> Hello all,
>> I'm setting my application up the way Simon suggested. I still use the
>> table object so I can get its name for displaying in one list, but the
>> other list (which holds the ac
sion.query(someTable) returns glorified tuples that can't be updated
> session.query(someMappedClass) returns instances of someMappedClass, that
> *can* be updated.
>
> Hope that makes sense,
>
> Simon
>
> On Thu, Feb 4, 2016 at 2:07 PM, Alex Hall <ah...@autodist.com>
(myEngine) #should create the
empty tables, right?
#main.py
from DBDefinitions import *
import DBInterface
c1 = Customer(...)
c2 = Customer(...)
mt1 = MyOtherTable(...)
if DBInterface.session.query(DBDefinitions.Customer).count == 0:
DBInterface.session.add_all([c1, c2])
On 2/4/16, Alex Hall <
returns all mapped classes, something like this:
>
> def getAllClasses():
> return base.__subclasses__()
>
> (If your class hierarchy is more complicated you'd need a more
> sophisticated function there)
>
> Simon
>
> On Thu, Feb 4, 2016 at 12:32 PM, Alex Hall
Hello all,
I'm setting my application up the way Simon suggested. I still use the
table object so I can get its name for displaying in one list, but the
other list (which holds the actual rows of the selected table) is
using the relevant subclass of base.
I use wx.ListCtrl to display everything,
On Tuesday, 25 August 2015 11:23:51 UTC+10, Alex Fraser wrote:
>
> Is there a declarative way to add foreign keys to the history table when
> using history_meta.py? In the app I'm making the user can view old versions
> of a document, and I want to make sure e.g. the user that cre
)
See here for unit tests for both of these issues. It uses an unmodified
*history_meta.py*.
https://github.com/z0u/satest/blob/master/test_versioned.py
Cheers,
Alex
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group
if the user
saving an object is different from the user who last saved it. I also
thought about adding an explicit *Versioned.create_version* method, but
this suffices for now.
Cheers,
Alex
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe
is duplicated.
E.g. instead of doing *user_name = v1.user.name*, I do:
user = self.session.query(User).filter_by(id=v1.user_id).one()
user_name = user.name
I feel like I'm doing something wrong; any suggestions for improving this
would be appreciated.
Cheers,
Alex
SQLAlchemy 1.0.8, Python 3
]
obj_changed = True
+else:
+# The attribute has never had a value
+attr[hist_col.key] = None
if not obj_changed:
# not changed, but we have relationships. OK
Is this a reasonable thing to do?
Cheers,
Alex
--
You received this message
The following script no longer works in 1.0.6, but does in 0.9.9:
from sqlalchemy.ext.declarative import declarative_base, AbstractConcreteBase
from sqlalchemy.ext.declarative.api import declared_attr
from sqlalchemy.orm.mapper import configure_mappers
from sqlalchemy.orm.session import Session
:18 AM, Alex Grönholm wrote:
The following script no longer works in 1.0.6, but does in 0.9.9:
from sqlalchemy.ext.declarative import declarative_base,
AbstractConcreteBasefrom sqlalchemy.ext.declarative.api import
declared_attrfrom sqlalchemy.orm.mapper import configure_mappersfrom
Thank you very much for your work, Mike.
--
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
Hi everyone!
I've found that contains_eager() does not load relation objects from query
in case when related model appears twice in query. The working code with
example models and steps to reproduce is listed in the attached file, I'll
briefly describe the issue here.
There are four models:
This update only fixes compatibility with SQLAlchemy 1.0.
--
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
Hey Jason,
Thanks for your reply. That makes sense I guess. It just feels like this is
something most webapps will need at some point and it's not as
straightforward as someone would imagine.
-- alex
On Monday, September 22, 2014 6:22:14 PM UTC+2, jason kirtland wrote:
Hi Alex,
I have
appreciate any help.
Thanks!
-- alex
--
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
Thanks. I've filed an issue
https://bitbucket.org/zzzeek/sqlalchemy/issue/3185/more-than-one-level-of-abstract-concrete
at Bitbucket.
A follow-up question: Why are abstract base classes not present in the
declarative class registry? Or is there another way to get all the mapped
classes
to get every class whether mapped or not, maybe use
Base.__subclasses__() ?
What’s the use case where you need the abstract base in the decl class
registry? it’s not really something you’d want to refer to in a
relationship().
On Sep 5, 2014, at 9:56 AM, Alex Grönholm alex.g...@nextday.fi
, type)]
perjantai, 5. syyskuuta 2014 17.19.21 UTC+3 Alex Grönholm kirjoitti:
You're right, I'm dumb. I should've just used __subclasses__ and be done
with it.
The use case is that I have a client-server app and I build a list of all
classes for the client so the client knows which column
Sorry to be asking more questions, but the docs on inheritance don't get
into much details on how the properties are supposed to work.
The following code produces unexpected results:
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import
The following code fails with AttributeError: 'NoneType' object has no
attribute 'concrete':
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import AbstractConcreteBase,
declarative_base
Base = declarative_base()
class Document(Base,
:47 AM, Alex Grönholm alex.g...@nextday.fi
javascript: wrote:
This has been a problem for me for years.
class DeliveryAddress(Base, Address):
...
delivery_method = Column(String)
...
@event.listens_for(DeliveryAddress, 'before_insert')
def
to
remain agnostic of, but it provides for you all the components you
need to create whatever system of hooks you'd like.
On Jun 2, 2014, at 8:04 AM, Alex Grönholm alex.gronh...@nextday.fi
mailto:alex.gronh...@nextday.fi wrote:
That's the first thing I tried, but validators don't get
This has been a problem for me for years.
class DeliveryAddress(Base, Address):
...
delivery_method = Column(String)
...
@event.listens_for(DeliveryAddress, 'before_insert')
def before_insert_deliveryaddress(mapper, connection, target):
settings =
There doesn't seem to be a class like MutableDict that provides equivalent
functionality for the ARRAY column type. Any particular reason why? I'd
like to be able to do .append() and .remove() on an array column. Do I have
to roll my own?
--
You received this message because you are
03.05.2014 16:04, Michael Bayer kirjoitti:
I'd like to provide mutablearray though, so if someone can roll it
with some tests it can go right in.
I'll look into it.
Sent from my iPhone
On May 3, 2014, at 9:02 AM, Alex Grönholm alex.gronh...@nextday.fi
mailto:alex.gronh...@nextday.fi wrote
to change this. I've tried to use
coerce_compared_value with no effect.
Alex
On Mon, Mar 31, 2014 at 8:49 PM, Alex quixop...@googlemail.com wrote:
The hybrid property and custom comparator approach works like a charm, I
had an inkling that hybrid propertyies were the correct approach but hadn't
(TestModel.flag_one)
And the negation of it:
session.query(TestModel).filter(not_(TestModel.flag_one))
I can't figure out how to emit the required SQL on comparison with a
boolean value though.
Alex
On Tue, Apr 1, 2014 at 1:54 PM, Michael Bayer mike...@zzzcomputing.comwrote:
On Apr 1, 2014, at 6
this in process_bind_param but then obviously there is no
current value of the flag integer for me to operate against. So, I'm a bit
lost, any ideas on how to implement this would be greatly appreciated.
Thanks
Alex
--
You received this message because you are subscribed to the Google Groups
The hybrid property and custom comparator approach works like a charm, I
had an inkling that hybrid propertyies were the correct approach but hadn't
really thought about subclassing hybrid_property, this has helped me
understand the custom types architecture a lot, thank very much.
Alex
On Mon
Hi there,
I've been hitting an intermittent bug with SQLAlchemy/PostgreSQL using an
HSTORE column. Some times, when I restart my process (pyramid over gevent
over chaussette), I get a spew of such errors... some other time,
everything goes just fine.
It seems this bug hasn't been documented
Greetings,
I've been reading through the docs and am still very new to SQLAlchemy but
haven't found an answer to my question. I am trying to write a query with
SQLAlchemy but don't want to build any objects if it can be helped. Is
this possible? I've read about reflection, but I'm still not
This release fixes compatibility with the just released SQLAlchemy 0.9.0
final.
--
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
Ah, I was completely unaware of tuple_(). That's what I was looking for.
Thanks!
keskiviikko, 18. joulukuuta 2013 18.31.42 UTC+2 Michael Bayer kirjoitti:
On Dec 17, 2013, at 8:39 PM, Alex Grönholm
alex.g...@nextday.fijavascript:
wrote:
I would like to check if two date ranges overlap
I would like to check if two date ranges overlap. This is done using the
OVERLAPS
operator http://www.postgresql.org/docs/9.2/static/functions-datetime.html
.
For example:
SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS
(DATE '2001-10-30', DATE '2002-10-30');
How do I do this in
This release fixes compatibility with SQLAlchemy 0.8.3 and onwards. The
test suite passes on SQLAlchemy 0.9.0b1 as well.
--
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
I wrote a blog post on this very topic recently:
http://alextechrants.blogspot.fi/2013/08/unit-testing-sqlalchemy-apps.html
tiistai, 10. syyskuuta 2013 19.43.35 UTC+3 Toph Burns kirjoitti:
Could you use an in-memory, sqlite db for your testing? For our
applications, we have an
I'm trying to test code that listens to session events on all sessions. I
can't pin it on any particular session or even sessionmaker due to the
architecture of the software (sessions are explicitly instantiated on the
fly).
All is well except that the listener sticks after the test is done,
There seems to be an undocumented function named remove() in the
sqlalchemy.event module that looks like what I want, but it doesn't work:
Traceback (most recent call last):
File
/home/alex/virtualenv/triancore/lib/python3.3/site-packages/nose/case.py,
line 198, in runTest
self.test
)
On Sep 11, 2013, at 1:44 PM, Alex Grönholm
alex.g...@nextday.fijavascript:
wrote:
Thanks for the quick reply. I don't want to use prerelease versions of
SQLAlchemy though. Is there any recommended way of doing this in 0.8.2?
keskiviikko, 11. syyskuuta 2013 20.40.40 UTC+3 Michael Bayer
This is another bugfix release. All reported issues have now been resolved.
Changes in this version:
- Fixed non-default schema name not being present in __table_args__
(fixes #2)
- Fixed self referential foreign key causing column type to not be
rendered
- Fixed missing
(img) values(:img)
DBSession.execute(sql, dict(img=bytearray(data))
data is not empty, but it just retrieves as bytearray(b'')
could you advice me?
many thanks in advance,
alex
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from
)
buffer = image.getvalue()
param = dict(picture=bytearray(buffer)
thanks a lot for your consideration :)
alex
there was no need to use pyodbc.Binary, since it has the very same effect.
On 06/12/2013 06:36 PM, Michael Bayer wrote:
blobs are problematic, and this is often highly dependent on DBAPI
This is a bugfix release. Issues resolved:
- Fixed TypeError when inflect could not determine the singular name of
a table for a many-to-1 relationship
- Fixed _IntegerType, _StringType etc. being rendered instead of proper
types on MySQL
--
You received this message because
Although it's only been a week since the initial release, I've already
added a bunch of new features.
Release highlights:
- Added automatic detection of joined-table inheritance
- Fixed missing class name prefix in primary/secondary joins in
relationships
- Instead of wildcard
I used joined table inheritance in Hibernate and it worked fine without any
extra discriminator columns. Why is it necessary in SQLAlchemy?
I can understand the need for such a column in single table inheritance,
but not joined table.
--
You received this message because you are subscribed to
18.05.2013 12:35, Chris Withers kirjoitti:
On 18/05/2013 01:28, Alex Grönholm wrote:
This is a tool that reads the structure of an existing database and
generates the appropriate SQLAlchemy model code, using the declarative
style if possible.
Playing devils advocate to get my head around
After a while of trying to fix sqlautocode, I ended up writing a new tool
instead.
Copypasta from the README:
-
This is a tool that reads the structure of an existing database and
generates the appropriate SQLAlchemy model code, using the declarative
Forgot to add the link: https://pypi.python.org/pypi/sqlacodegen
--
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
The following class works on 0.8.0b2 but not 0.8.0 final:
class EnumWrapper(SchemaType, TypeDecorator):
def __init__(self, cls):
kwargs = {'name': cls.__name__.lower()}
self.impl = Enum(*(obj.key for obj in cls.values), **kwargs)
self.wrapped = cls
def
10.04.2013 18:06, Michael Bayer kirjoitti:
On Apr 10, 2013, at 5:10 AM, Alex Grönholm alex.gronh...@nextday.fi
mailto:alex.gronh...@nextday.fi wrote:
The following class works on 0.8.0b2 but not 0.8.0 final:
class EnumWrapper(SchemaType, TypeDecorator):
def __init__(self, cls
to executescript.
is there any proved way to go? any special paramstyle?
thanks in advance,
alex
--
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, send email
in the relations takes
too long and needs alot of memory.
Is there an option to do that implicitly on a loaded entity, because I do
not want to invoke each single relation to load it explicitly?
Cheers,
Alex
--
You received this message because you are subscribed to the Google Groups
sqlalchemy
)
What am I doing wrong? Is there a way to create a User from a Person?
Thanks in advance,
Alex
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/yYDW-COkmvkJ
So, there's no way to upgrade a Person to a User within the normal ORM?
Thanks,
Alex
On Oct 29, 2012 3:00 PM, Michael Bayer mike...@zzzcomputing.com wrote:
On Oct 29, 2012, at 5:06 AM, Alex Chamberlain wrote:
I posted this on StackOverflow (http://stackoverflow.com/q/13109085/961353
.
Alex
On Monday, October 29, 2012 3:47:51 PM UTC, Michael Bayer wrote:
there's an old ticket proposing to add the feature of changing the class
of an item but it has many tricky turns and corners and hasn't been worth
the large amount of effort it would take to make it work perfectly in all
Is there a good way to have a dialect automatically add casting to 'THEN'
expressions in 'CASE' statements?
I'm working on a dialect for the H2 database, via Jython. H2 requires
values in a 'THEN' expression to have explicit casts (see: Unknown data
type thrown with a case statement where all
Roger that, thanks for the prompt response.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/XU4Zfrz8KJQJ.
To post to this group, send email to
to the
Text() pre-established, with the required=True flag turned on.
thought of it too, but it won't do the work: i needed to catch :variables
missing in the given bindparm.
thanks a lot,
alex
On Aug 27, 2012, at 12:06 PM, alex bodnaru wrote:
hello friends,
for a migrated
PM, alex bodnaru wrote:
hello friends,
for a migrated system, i'm using textual queries in the form:
dbsession.execute(select name from table where id=:id, dict(id=1))
to my surprise, select ... id=:idd would still work, asuming idd is
null,
despite 'idd' is not in bindparms
in _TextClause __init__() would indeed make
the 'idd' column required, thus raise an exception when not found in bind
dict(id=1).
is there an official way to acomplish this, or should i just hack in hardcoded?
thanks in advance,
alex
--
You received this message because you are subscribed
='Deutsch')
session.add(de)
data = PageData(lang_code='de', data=uVielen Dank im Voraus) #this works
data = PageData(lang=de, data=uVielen Dank im Voraus) #this fails
session.add(data)
session.flush()
thanks in advance,
alex
On 07/15/2012 07:08 PM, Michael Bayer wrote:
On Jul 15, 2012, at 5:53 AM
thank you very much michael.
both ways worked like a charm.
i have implemented the other way, though this is better and more general: any
constraint with onupdate or ondelete attributes should have these attributes set
to none if the dialect name is mssql.
thanks a lot,
alex
On 07/16/2012 05
hello michael, friends,
On 07/11/2012 10:31 AM, alex bodnaru wrote:
hello michael,
now it works. i also had to add uselist=False.
i tried it the longest way possible, by adding a Pool first_connect listener,
but this was not really needed. just the uselist.
thanks a lot,
alex
hello michael,
now it works. i also had to add uselist=False.
i tried it the longest way possible, by adding a Pool first_connect listener,
but this was not really needed. just the uselist.
thanks a lot,
alex
On 07/09/2012 04:25 PM, Michael Bayer wrote:
On Jul 9, 2012, at 4:48 AM, alex
) #this relationship won't work, since at
the moment the class is being made, the foreign key is not there yet.
the foreign_keys=Lang.lang_code arg does calm the exception, but doesn't do the
work.
could i add the relationship to the mapper on the same event?
thank in advance,
alex
On 07/07/2012 05:13 PM
it worked very well,
thanks a lot michael :),
alex
On 07/07/2012 05:13 PM, Michael Bayer wrote:
sure engine and connection have .dialect.name. Foreign key constraints
don't matter on SQLite unless you've actually enabled them, which is rare.
I'd still use an event though so at least
thanks a lot michael.
i think i'll go this way :)
best regards,
alex
On 07/07/2012 05:13 PM, Michael Bayer wrote:
sure engine and connection have .dialect.name. Foreign key constraints
don't matter on SQLite unless you've actually enabled them, which is rare.
I'd still use an event
hello friends,
i need to define a foreign key differently for different dialects:
ondelete='restrict' for most engines, but nothing (implied and not recognized)
for mssql.
could you help?
thanks in advance,
alex
--
You received this message because you are subscribed to the Google Groups
(.)
if get_dialect() != 'mssql':
fk_parms.update(onupdate='restrict')
fk = ForeignKey(**fk_parms)
would the dialect be accessible from the engine, metadata etc?
thanks in advance,
alex
On 07/06/2012 11:39 PM, Michael Bayer wrote:
you'd use ForeignKeyConstraint along with the AddConstraint directive
06.06.2012 18:06, Michael Bayer kirjoitti:
you need to use the post_update option described at
http://docs.sqlalchemy.org/en/rel_0_7/orm/relationships.html#rows-that-point-to-themselves-mutually-dependent-rows
.
Thanks for the pointer. Problem solved :)
On Jun 6, 2012, at 1:15 AM, Alex
I have trouble configuring two relationships from one class to another. The
following code should be fairly self-explanatory:
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Company(Base):
the movies, which does not happen.
When you set Entity as the baseclass of Movie and Director it works.
Is this a bug or is there a reason I don't see?
Thx in advance,
alex
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send
praise for your work on sqlalchemy :D
alex
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/_RONPI3aMWwJ.
To post to this group, send email to sqlalchemy
We use this recipe and in 0.7.5 it works ok with limit and offset.
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/old/DebugInlineParams
On Fri, Mar 9, 2012 at 10:32 AM, Randy Syring rsyr...@gmail.com wrote:
I found a recipe on stackoverflow for turning a query instance into a
string,
Yup, this is exactly what I did just 2 minutes ago :)
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/Eto2-sirT7wJ.
To post to this group, send email to
Thanks!
Great work! :)
On Sat, Jan 21, 2012 at 3:18 AM, Conor conor.edward.da...@gmail.com wrote:
def get_constraint_name(e):
# Unique constraint violations in PostgreSQL have error code 23505.
if e.orig.pgcode == 23505:
return re.search(r'^ERROR: duplicate key value violates
hello friends,
i'm using sa at a quite low level, with session.execute(text, dict)
is it possible to do something in the spirit of:
session.execute(select * from tablename where id in (:ids),
dict(ids=[1,2,3,4])) ?
thanks in advance,
alex
--
You received this message because you
hello friends,
i'm happily using sqlalchemy in a tg 2.1 project. with a legacy database, thus
my queries are in the form of dbsession.execute(sql).
where should i hook a strip of the data from a char(len) field? this is needed
for this application only.
best regards and merry christmas,
alex
I need EmptyQuery because query that returns from my function used for
different cases,
and if I return [], it will raise error, because [] not has query methods
like order_by.
e.g.
query1 = getComments(user_id).order_by('comment.time_create desc')
query2 = getComments(user_id).order_by('id')
Hi ,
I'm using SA 0.5.
query1 = session.query(literal_column('Phrase').label('type')).filter(...)
query2 = session.query(literal_column('Exact').label('type')).filter(...)
and then :
query1.union(query2)
gives me :
SELECT* 'Phrase' as type*
FROM (SELECT 'Phrase' as type FROM table1 WHERE
My use case is the following: each SalesItem requires a calcPriceList and a
salesPriceList (of type PriceList) attached to it.
For that, SalesItem has two fields:
calcpricelist_id = Column(BigInteger, ForeignKey(PriceList.id),
nullable=False)
salespricelist_id = Column(BigInteger,
How silly of me not to have checked that in the docs. Rather embarrassing
really :) Thanks.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/rTk1ea1hvrgJ.
To
Yeah my bad, the original query does indeed query for (Z.id, B.name). I had
just changed it to A.name to get the printout for the workaround query
and forgot to change it back before pasting here.
If there's something I can do to contribute (not sure I'm qualified to
write those tests), do
I encountered a little strangeness when joining to a class using single
table inheritance.
I was wondering why I got no results for one particular query.
This was originally encountered with PostgreSQL but was successfully
reproduced with SQLite.
Is this a bug or a user error?
Thanks, but if I need allow nullable primary_keys it not works.
I tried:
user_id = db.Column(db.Integer, db.ForeignKey('user.id', ondelete='SET
NULL'), primary_key=True, nullable=True, server_default=text('NULL'))
it generates
CREATE TABLE user_ip (
user_id INTEGER DEFAULT NULL,
PRIMARY KEY
='
127.0.0.1/32')
and it raise error:
ArgumentError: Mapper Mapper|UserIp|user_ip could not assemble any primary
key columns for mapped table 'user_ip'
Thanks!
On Fri, Nov 11, 2011 at 2:35 PM, Wichert Akkerman wich...@wiggy.net wrote:
On 11/11/2011 11:20 AM, Alex K wrote:
Thanks, but if I
try doing:
level in row
instead of recompiling the query with __str__() each time, very expensive,
also not very accurate
Thanks!
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
Maybe compiler from sqlalchemy can help me?
from sqlalchemy.sql import compiler
from sqlalchemy.sql.expression import text
t = text(st)
c = compiler.SQLCompiler(db.engine.dialect, t)
and now I don't know how pass the params dict to compiler.
Thanks.
On Fri, Oct 21, 2011 at 6:40 PM, Michael
On Wed, Oct 19, 2011 at 7:57 PM, Michael Bayer mike...@zzzcomputing.comwrote:
but I can't add options contains_eager like
result = result.options(contains_eager(Comment.user))
Well no because you're digging way into RECURSIVE queries which SQLA
doesn't yet support very nicely. Mapping
:
On Oct 20, 2011, at 4:03 AM, Alex K wrote:
result2 = db.session.query(non_primary_mapper).from_statement('SELECT
test.id AS test_id, test.user_id AS test_user_id, test.reply_id AS
test_reply_id, test.text AS test_text FROM test LEFT OUTER JOIN user ON
user.id = test.user_id LIMIT 1 OFFSET
0
', content_comments_level_add)
and it works.
Thanks!
On Thu, Oct 20, 2011 at 6:54 PM, Michael Bayer mike...@zzzcomputing.comwrote:
On Oct 20, 2011, at 10:45 AM, Alex K wrote:
I solve this problem with new custom Query class:
it appears all you're doing is injecting an extra column
101 - 200 of 324 matches
Mail list logo