I'm using the ORM and one of my tables does not have a primary key defined.
I am also using DeferredReflection, and I can't seem to figure out how to
defer the PrimaryKeyConstraint until Base.prepare() runs. Any pointers?
Base = declarative_base(cls=DeferredReflection)
class Person(Ba
or 0.8 and 0.9.
>
> On Feb 27, 2014, at 7:29 PM, Michael Bayer
> >
> wrote:
>
>
> On Feb 27, 2014, at 4:38 PM, Rob Crowell >
> wrote:
>
>
> # in_ clause with 1 STRING, 1 BINARY
> filter_cols = tuple_(HashTest.hash_val, HashTest.hash_type)
>
When I pass binary data to a multi-column in_ clause, I seem to be geting
inconsistent results and I need some help! I did some testing with MySQL,
Postgres, and Vertica (connecting via
https://pypi.python.org/pypi/vertica-sqlalchemy/0.1). It appears MySQL
works correctly but both Postgres an
Interesting, thanks Michael. I didn't realize autoload was implied when
using DeferredReflection but that makes sense.
Thanks!
On Monday, February 17, 2014 7:17:34 PM UTC-5, Michael Bayer wrote:
>
>
> On Feb 17, 2014, at 6:23 PM, Rob Crowell >
> wrote:
>
> I am havin
I am having a bit of trouble getting DeferredReflection working the way I
want; not sure if I am overlooking something obvious or if I just don't
really understand how it's supposed to work.
I'm trying to define my models before creating my engine (this does not
work):
Base = declarative_bas
, February 27, 2013 2:48:21 PM UTC-5, Michael Bayer wrote:
>
>
> On Feb 27, 2013, at 2:40 PM, Rob Crowell >
> wrote:
>
> Ah okay, so you do recommend the contains_eager approach. I guess this is
> exactly the use-case it is designed for? I always get a little scared when
hought you
> had a more complex query.contains_eager() doesn't impact what's
> queried, only how results are used with the resulting objects, and is
> usually used with join(), just like this:
>
> session.query(Person).\
> join(Person.visited_destinations, Vis
of that SQL to route into
> your contains_eager(). We do that second.
>
> So let me know if you know the actual SQL you want to do first; we'd work
> from there. Don't deal with joinedload or contains_eager or any of that
> yet.
>
>
> On Feb 27, 2013, at 2:07 AM,
I'm not sure of the proper way to link to previous discussions (or indeed
if I am even the hapless user that Michael was referring to!), but this
sounds like what Michael was talking about for reference:
https://groups.google.com/d/topic/sqlalchemy/ETFlrQrmdHk/discussion
On Saturday, February
Example code: https://gist.github.com/rcrowell/5045832
I have Person and Town tables, which are joined in a many-to-many fashion
through a VisitedDestinations table. I want to write a query which will
return People that have visited either Atlanta or Memphis. I have a
working example using co
I'm building a pyramid application using pyramid_tm and
ZopeTransactionExtension. We've written a little subscriber on NewResponse
that writes out some values to a log file about the current user
(request.user.id) after each request. For anybody that knows pyramid
pretty well, we set the requ
Thanks Michael,
Writing a big list of conditions and combining them with and_(*conditions)
worked well. I was indeed querying like this before:
for condition in conditions:
q = q.filter(condition)
print q
On Friday, January 18, 2013 6:00:04 PM UTC-5, Michael Bayer wrote:
>
>
> On Jan 18, 2
I haven't boiled this down to a short test case yet, but when my WHERE
clause gets especially long I start getting the "recursion depth exceeded"
exception. Is this a well-known limitation of sqlalchemy? We're running
this query in production currently without SQLAlchemy, and it performs
fine
olumns(IssueTypeLabel)
This code correctly prints the following:
issue type: ['id', 'type', 'created', 'num_visits']
issue label: ['id', 'label_id', 'created', 'num_visits']
issue type label: ['id',
On Nov 15, 10:48 pm, Michael Bayer wrote:
> On Nov 15, 2012, at 7:33 PM, Rob Crowell wrote:
>
>
>
>
>
>
>
>
>
> > Sorry, that got cut off at the end.
>
> > class IssueTag(Base):
> > __tablename__ = 'issue_user_tag'
>
> >
ns on an existing Table object.
On Thursday, November 15, 2012 7:32:29 PM UTC-5, Rob Crowell wrote:
>
> I'm working with a denormalized cache schema, and I've run into a
> situation where it would be helpful to be able to create multiple classes
> that extend Base but refer t
I'm working with a denormalized cache schema, and I've run into a situation
where it would be helpful to be able to create multiple classes that extend
Base but refer to the same __tablename__. Is this possible to do? I am
getting this Exception:
sqlalchemy.exc.InvalidRequestError: Table '
17 matches
Mail list logo